Well, backquotes are already used in Haskell to convert prefix symbols to
infix, so I decided to reuse backquotes to convert infox symbols to prefix
^^

"let" and "where" syntax is always a problem...

data (List a)
. `:` :: a -> List a -> List a
. Nil :: List a
codata (Stream a)
. head :: Stream a -> a
. tail :: Stream a -> Stream a

The main point is really just to implement syntax extensions in a non-Lisp
language. ^^ In the 80's Scheme macrologists would discuss a little about
using Scheme-style macros in C (!), but in the late 80's and 90's such
mentions in the Scheme macro papers grew less and less until they just
mention Scheme.

Some more examples:

codata (Rec a)
. stepRec :: Rec a -> Either (Rec a) a
instance (Monad Rec)
. -- codata types (Rec a) use copatterns
. stepRec (return a) = Right a
. stepRec (ma >>= fmb) = case (stepRec ma)
. . Left ma' -> Left (ma' >>= fmb)
. . Right a -> fmb a
-- Fix point operator
fixRec :: ((a -> Rec b) -> (a -> Rec b)) -> (a -> Rec b)
stepRec (fixRec ff a) = value
. ff subcall a
. where
. . stepRec (subcall a') = fixxRec ff a'
------------------------------------------------------------------------------
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to