Questions tagged [curry]

Curry is an experimental functional logic programming language, based on the Haskell language. It merges elements of functional and logic programming, including constraint programming integration.

Curry is developed as a universal programming language. It is closely related to Haskell but provides logic programming features. There are several implementations, and there are tools for both documentation and testing.

24 questions
1
vote
2 answers

Inverting `member` in Curry (PAKCS) gives no answers

With this definition: member _ [] = False member x (h:t) = if x == h then True else member x t PAKCS 2.0.1 (from Ubuntu 18.04) gives no answers, warnings or errors: Top-level binding with no type signature: member :: Prelude.Eq a => a ->…
1
vote
1 answer

The PAKCS REPL consider something undefined, but the module defining it is loaded

The problem My code includes a module called Tests which defines the following: broken :: SetRBT Int broken = insertRBT 1 $ emptySetRBT (<) I can evaluate broken in the REPL: All> broken RedBlackTree.RedBlackTree (_impl#==#Prelude.Eq#Prelude.Int)…
Jeffrey Benjamin Brown
  • 3,427
  • 2
  • 28
  • 40
1
vote
1 answer

What problems does curry's choice solve?

I am familiar with what choice operator ((?)) does, it takes two arguments and matches to both of them. We could define it as follows: a?_=a _?b=b This can be used to introduce non-determinism between two values. However what I don't understand…
Wheat Wizard
  • 3,982
  • 14
  • 34
1
vote
1 answer

Why does the Münster compiler believe a pattern match across ++ is non-deterministic?

I recently installed the Münster Curry Compiler to replace the much slower PAKCS that I was using. The first thing I wanted to test was whether I could use some of the pattern matching features from PAKCS, because I know some implementations (Sloth…
1
vote
1 answer

How to limit search space in Curry?

Below is my first program in Curry. It prints sequence of steps required for reaching a desired solution (walking through a closed door). Evaluating expression: main Done (Just [Open,Walk,Close]) How can I make it terminate when looking for…
Rumca
  • 1,809
  • 12
  • 17
0
votes
0 answers

Pass final positional argument in a curried function to the last parameter available

Given a simple curried function import toolz @toolz.curry def mklist(x, y, z): return [x, y, z] obviously calling mklist(x=1, y=2)(z=3) works. What I would like to be able to do is to call the function like so: mklist(x=1, y=2)(3), where z…
upgrd
  • 720
  • 7
  • 16
0
votes
1 answer

I can't use fromInteger or realtoFrac in curry

I'm using an old version of curry and all functions of Haskell works fine so far, but I have problem with realtoFrac and fromInteger Prelude> :t fromInteger PAKCS_Main_Exp.curry, line 2.17: Error: `fromInteger' is undefined ERROR occurred…
Raul
  • 27
  • 2
0
votes
1 answer

In Curry, how to get inverse reverse function to terminate?

I'm using the PAKCS Curry compiler, version 3.3.0. Here's a naive list reversal function in Curry (it works in Haskell too): rev :: [a] -> [a] rev [] = [] rev (x : xs) = (rev xs) ++ [x] Let's try to invert the function, i.e. find a list l whose…
Adam Dingle
  • 3,114
  • 1
  • 16
  • 14
0
votes
1 answer

Generating a parser with `inverse`, with constraints on the grammar

I recently followed through A Taste of Curry, and afterwards decided to put the trivial arithmetic parser example to test, by writing a somewhat more substantial parser: a primitive but correct and functional HTML parser. I ended up with a working…
Erik Kaplun
  • 37,128
  • 15
  • 99
  • 111
1
2