Hi! I've read that Curry is a super set of Haskell, except for the type classes. But some Curry implementations do also include Haskell type classes. Does that mean, that Haskell code can easily be used inside Curry programs? Like C in C++? Is it possible to use all those Haskell libraries in Curry? Or, if not, is it very easy to port Haskell to Curry? Cheers Volker
Maybe it's a superset of Haskell 98? Modern Haskell has more than two hundred language extensions, a few dozen of which are quite popular. Code that uses those will not in general (ever?) be something you can just drop unchanged into a Curry project. Some of the extensions (e.g. ViewPatterns, LambdaCase, OverloadedStrings, TupleSections) are basically syntactic sugar, and it's easy to rewrite your code without them. Others (DataKinds, GADTs, TypeFamilies, RankNTypes) let you do things that are impossible otherwise. On Mon, Dec 16, 2019 at 12:01 PM Volker Wysk <post@volker-wysk.de> wrote:
Hi!
I've read that Curry is a super set of Haskell, except for the type classes. But some Curry implementations do also include Haskell type classes.
Does that mean, that Haskell code can easily be used inside Curry programs? Like C in C++? Is it possible to use all those Haskell libraries in Curry?
Or, if not, is it very easy to port Haskell to Curry?
Cheers Volker _______________________________________________ curry mailing list -- curry@lists.rwth-aachen.de To unsubscribe send an email to curry-leave@lists.rwth-aachen.de https://lists.rwth-aachen.de/postorius/lists/curry.lists.rwth-aachen.de
-- Jeff Brown | Jeffrey Benjamin Brown Website <https://msu.edu/~brown202/> | Facebook <https://www.facebook.com/mejeff.younotjeff> | LinkedIn <https://www.linkedin.com/in/jeffreybenjaminbrown>(spammy, so I often miss messages here) | Github <https://github.com/jeffreybenjaminbrown>
Hi I see. But TWO HUNDRED extensions?? =:-| So it depends on the code, which you want to port to Curry, and which Haskell extensions it uses, how feasible it is to do that. Thanks. Volker Am Montag, den 16.12.2019, 14:13 -0500 schrieb Jeffrey Brown:
Maybe it's a superset of Haskell 98? Modern Haskell has more than two hundred language extensions, a few dozen of which are quite popular. Code that uses those will not in general (ever?) be something you can just drop unchanged into a Curry project.
Some of the extensions (e.g. ViewPatterns, LambdaCase, OverloadedStrings, TupleSections) are basically syntactic sugar, and it's easy to rewrite your code without them. Others (DataKinds, GADTs, TypeFamilies, RankNTypes) let you do things that are impossible otherwise.
On Mon, Dec 16, 2019 at 12:01 PM Volker Wysk <post@volker-wysk.de> wrote:
Hi!
I've read that Curry is a super set of Haskell, except for the type classes. But some Curry implementations do also include Haskell type classes.
Does that mean, that Haskell code can easily be used inside Curry programs? Like C in C++? Is it possible to use all those Haskell libraries in Curry?
Or, if not, is it very easy to port Haskell to Curry?
Cheers Volker _______________________________________________ curry mailing list -- curry@lists.rwth-aachen.de To unsubscribe send an email to curry-leave@lists.rwth-aachen.de https://lists.rwth-aachen.de/postorius/lists/curry.lists.rwth-aachen.de
231 extensions as of GHC 8.6.5. (Some people are using 8.8 in production already, and 8.10 is available but not stable yet.) Of course, any Turing-complete language can do anything any other can. There exists code that uses things like GADTs without really needing to. But then again there are programs that would be really verbose and confusing without the extensions. On Mon, Dec 16, 2019 at 2:59 PM Volker Wysk <post@volker-wysk.de> wrote:
Hi
I see. But TWO HUNDRED extensions?? =:-|
So it depends on the code, which you want to port to Curry, and which Haskell extensions it uses, how feasible it is to do that.
Thanks.
Volker
Am Montag, den 16.12.2019, 14:13 -0500 schrieb Jeffrey Brown:
Maybe it's a superset of Haskell 98? Modern Haskell has more than two hundred language extensions, a few dozen of which are quite popular. Code that uses those will not in general (ever?) be something you can just drop unchanged into a Curry project.
Some of the extensions (e.g. ViewPatterns, LambdaCase, OverloadedStrings, TupleSections) are basically syntactic sugar, and it's easy to rewrite your code without them. Others (DataKinds, GADTs, TypeFamilies, RankNTypes) let you do things that are impossible otherwise.
On Mon, Dec 16, 2019 at 12:01 PM Volker Wysk <post@volker-wysk.de> wrote:
Hi!
I've read that Curry is a super set of Haskell, except for the type classes. But some Curry implementations do also include Haskell type classes.
Does that mean, that Haskell code can easily be used inside Curry programs? Like C in C++? Is it possible to use all those Haskell libraries in Curry?
Or, if not, is it very easy to port Haskell to Curry?
Cheers Volker _______________________________________________ curry mailing list -- curry@lists.rwth-aachen.de To unsubscribe send an email to curry-leave@lists.rwth-aachen.de
https://lists.rwth-aachen.de/postorius/lists/curry.lists.rwth-aachen.de
-- Jeff Brown | Jeffrey Benjamin Brown Website <https://msu.edu/~brown202/> | Facebook <https://www.facebook.com/mejeff.younotjeff> | LinkedIn <https://www.linkedin.com/in/jeffreybenjaminbrown>(spammy, so I often miss messages here) | Github <https://github.com/jeffreybenjaminbrown>
Hi Volker, such a statement should be relaxed to the intention that Curry is conceptually an extension of functional programming a la Haskell. Thus, the syntax is oriented towards Haskell, and the operational semantics is non-strict as in Haskell, if logic features are not used, but Curry offers also demand-driven non-determinism. As Jeffrey pointed out, Haskell has many features that are not (yet?) supported (there is no principle reason for it, just a matter of work). However, there is one important difference: Haskell has a sequential interpretation of equations, i.e., a rule like "p x = True" does not imply that predicate p always delivers True but it depends on preceding rules for p. In Curry, overlapping rules lead to non-deterministic programs. Furthermore, Curry programs might yield results where Haskell does not terminate due to a different (optimal) pattern matching strategy. Thus, many Haskell programs have an identical meaning in Curry but not all. Regards, Michael On 16.12.19 18:00, Volker Wysk wrote:
Hi!
I've read that Curry is a super set of Haskell, except for the type classes. But some Curry implementations do also include Haskell type classes.
Does that mean, that Haskell code can easily be used inside Curry programs? Like C in C++? Is it possible to use all those Haskell libraries in Curry?
Or, if not, is it very easy to port Haskell to Curry?
Cheers Volker
Am Montag, den 16.12.2019, 23:18 +0100 schrieb Michael Hanus:
However, there is one important difference: Haskell has a sequential interpretation of equations, i.e., a rule like "p x = True" does not imply that predicate p always delivers True but it depends on preceding rules for p. In Curry, overlapping rules lead to non-deterministic programs. Furthermore, Curry programs might yield results where Haskell does not terminate due to a different (optimal) pattern matching strategy. Thus, many Haskell programs have an identical meaning in Curry but not all.
I'm a long-term Haskell user. Yes, that difference in the interpretation of equations was a source of confusion when I (partially) learned Mercury a few months ago... So you can't avoid looking at the entire code closely, when you want to port from Haskell to Curry. Goodbye, Volker
On 12/17/19 2:36 PM, Volker Wysk wrote:
I'm a long-term Haskell user. Yes, that difference in the interpretation of equations was a source of confusion when I (partially) learned Mercury a few months ago...
So you can't avoid looking at the entire code closely, when you want to port from Haskell to Curry.
Yes, this is true. You can translate each function individually, but to avoid such misinterpretations, the patterns have to be considered. Fortunately, our current front end provides warnings in case of overlapping rules. Furthermore, the Curry program analysis system CASS contains also (non)determinism analyses which shows you potential sources of non-deterministic behavior. This could be helpful when you port Haskell programs. Regards, Michael
Am Donnerstag, den 19.12.2019, 10:46 +0100 schrieb Michael Hanus:
On 12/17/19 2:36 PM, Volker Wysk wrote:
I'm a long-term Haskell user. Yes, that difference in the interpretation of equations was a source of confusion when I (partially) learned Mercury a few months ago...
So you can't avoid looking at the entire code closely, when you want to port from Haskell to Curry.
Yes, this is true. You can translate each function individually, but to avoid such misinterpretations, the patterns have to be considered. Fortunately, our current front end provides warnings in case of overlapping rules. Furthermore, the Curry program analysis system CASS contains also (non)determinism analyses which shows you potential sources of non-deterministic behavior. This could be helpful when you port Haskell programs.
Sounds good. Thanks. Volker
participants (3)
-
Jeffrey Brown
-
Michael Hanus
-
Volker Wysk