Discussion:
Fudget and Miranda
(too old to reply)
Duke Normandin
2010-05-13 16:23:44 UTC
Permalink
I can't help it! I _really_ like Miranda! _For me_, it's simple and
intuitive.

Is anybody still alive that would have used Miranda, and could tell me if
the GUI library "Fudget" can be coaxed to work with Miranda. TIA...
--
Duke Normandin
*** Tolerance becomes a crime, when applied to evil [Thomas Mann] ***
raould
2010-05-14 17:45:40 UTC
Permalink
Post by Duke Normandin
I can't help it! I _really_ like Miranda! _For me_, it's simple and
intuitive.
i have not used Miranda, only Haskell which I thought was a
descendant. might you summarize how different you feel they are? like,
is Haskell really that much worse? thanks :-)
Torben Ægidius Mogensen
2010-05-17 09:29:12 UTC
Permalink
Post by raould
Post by Duke Normandin
I can't help it! I _really_ like Miranda! _For me_, it's simple and
intuitive.
i have not used Miranda, only Haskell which I thought was a
descendant. might you summarize how different you feel they are? like,
is Haskell really that much worse? thanks :-)
Haskell has several ancestors, one of which is Orwell, which is itself
an ancestor of Miranda. Miranda is a much smaller/simpler language than
Haskell, which some people prefer.

Miranda has a feature not easily copied in Haskell: A diagonalising list
comprehension. If you, for example write [f x y | x<-[1..], y<-[1..]]
in Haskell or Miranda, you nget the sequence [f 1 1, f 1 2, f 1 3, ...],
never getting to f 2 1. In Miranda, you can write [f x y \\ x<-[1..],
y<-[1..]] (or something similar, I'm not sure about the syntax) to
generate x and y in a different sequence, so you get [f 1 1, f 1 2, f 2
1, f 1 3, f 2 2, f 3 1, ...] which will, eventually, generate f m n for
all m and n.

Torben
Dan Doel
2010-05-17 16:25:54 UTC
Permalink
Post by Torben Ægidius Mogensen
Miranda has a feature not easily copied in Haskell: A diagonalising list
comprehension. If you, for example write [f x y | x<-[1..], y<-[1..]]
in Haskell or Miranda, you nget the sequence [f 1 1, f 1 2, f 1 3, ...],
never getting to f 2 1. In Miranda, you can write [f x y \\ x<-[1..],
y<-[1..]] (or something similar, I'm not sure about the syntax) to
generate x and y in a different sequence, so you get [f 1 1, f 1 2, f 2
1, f 1 3, f 2 2, f 3 1, ...] which will, eventually, generate f m n for
all m and n.
It's only as difficult as importing Control.Monad.Omega (from the package
with a similar name).

take 10 . runOmega $ do x <- each [1..] ; y <- each [1..] ; return (x, y)
=>
[(1,1),(1,2),(2,1),(1,3),(2,2),(3,1),(1,4),(2,3),(3,2),(4,1)]

Technically it's not a monad, but it's the functionality in question.
Lauri Alanko
2010-05-18 23:08:56 UTC
Permalink
Post by Torben Ægidius Mogensen
Miranda has a feature not easily copied in Haskell: A diagonalising list
comprehension. If you, for example write [f x y | x<-[1..], y<-[1..]]
in Haskell or Miranda, you nget the sequence [f 1 1, f 1 2, f 1 3, ...],
never getting to f 2 1. In Miranda, you can write [f x y \\ x<-[1..],
y<-[1..]] (or something similar, I'm not sure about the syntax) to
generate x and y in a different sequence, so you get [f 1 1, f 1 2, f 2
1, f 1 3, f 2 2, f 3 1, ...] which will, eventually, generate f m n for
all m and n.
This is certainly easily copied in Haskell:


newtype L a = L { unL :: [a] }

instance Monad L where
return a = L [a]
L xs >>= f = L (diagonalize (map (unL . f) xs))

diagonalize :: [[a]] -> [a] -- fun exercise, I don't want to spoil it
Post by Torben Ægidius Mogensen
take 10 $ unL $ do x <- L [1..]; y <- L [1..]; return (x, y)
[(1,1),(1,2),(2,1),(1,3),(2,2),(3,1),(1,4),(2,3),(3,2),(4,1)]

Good enough?


Lauri

Continue reading on narkive:
Loading...