Re:Miranda: A non-strict functional language with polymorphi...
by rjeli on Wednesday May 03, 2017 @05:45PM
(#14260449)
I agree that Haskell guards are aesthetically uglier, but they're much easier to read with the conditional before the result.
Re:Miranda: A non-strict functional language with polymorphi...
by theoh on Wednesday May 03, 2017 @06:19PM
(#14260742)
Someday the equivalence between the notations will make it possible to (gasp) automagically translate between the two. If we're still typing programs.
Re:Miranda: A non-strict functional language with polymorphi...
by rjeli on Wednesday May 03, 2017 @06:29PM
(#14260800)
And then we'll have AST wars instead of language wars... unless we can compile to and from Turing machine instructions :-D
Re:Miranda: A non-strict functional language with polymorphi...
by Risord on Thursday May 04, 2017 @06:50AM
(#14263904)
Hopefully we skip that AST phase and go directly more meaningful and still less visual related layer. Is it called ASG or something.
Edit: We probably have wars anyway but I think after that our wars are about something that really matters.
Re:Miranda: A non-strict functional language with polymorphi...
by n4r9 on Thursday May 04, 2017 @03:31AM
(#14263188)
I found the Miranda version much easier to read. But then I'm a mathematician who has never used Haskell, and it's fairly similar to how mathematicians write multi-line functions.
Re:Miranda: A non-strict functional language with polymorphi...
by houli on Wednesday May 03, 2017 @07:51PM
(#14261294)
It's mentioned in the Wikipedia article that monad comprehensions are available as a GHC language extension
Re:Miranda: A non-strict functional language with polymorphi...
by i_don_t_know on Thursday May 11, 2017 @05:20AM
(#14314784)
I vaguely seem to remember that the designer's of Haskell picked a different syntax for guards to make the language look less like Miranda. Miranda was owned by a private company (IIRC) and they didn't want to run the risk of infringing on their IP. But I don't know if that's really true.
Re:Miranda: A non-strict functional language with polymorphi...
by GregBuchholz on Wednesday May 03, 2017 @07:02PM
(#14261008)
If you like "if guards", and want a non-whitespace delimited, strict, dynamically typed language, check out the Pure language:
gcd a b = gcd (a-b) b if a>b;
= gcd a (b-a) if a<b;
= a otherwise;
https://agraef.github.io/pure-lang/
So I started using Mark Jones' Gofer[1] interpreter which was trivial to build and still is 20 years later assuming you can find the source tar ball. It kept the nicer syntax of Miranda and added most of the power features of Haskell. I particularly liked the generalized list comprehension feature which really should have made it into Haskell; things like combinator parser code reads beautifully with it.
I know it's what you're used to but Haskell code always looks ugly to me in comparison to Miranda or Gofer.
[1] https://en.wikipedia.org/wiki/Gofer_(programming_language)