[Haskell-cafe] Announcement: Bang, a drum DSL for Haskell
Bertram Felgenhauer
bertram.felgenhauer at googlemail.com
Tue Jun 10 23:25:48 UTC 2014
Richard A. O'Keefe wrote:
>
> On 10/06/2014, at 8:15 PM, J. Waldmann wrote:
> > * (as with all Haskell EDSLs for music) a basic inconvenience in writing and
> > reading is that the "space" symbol is application, while we actually want it
> > for concatenation, to write a sequence of events without extra syntax
> > (concatenation operators, or commas in list literals).
>
> So you can't write a, a b, a b c, a b c d, and so on meaning
> concatenation every time, but can't you use the ideas of
> http://okmij.org/ftp/Haskell/polyvariadic.html#polyvar-fn
> to write f a, f a b, f a b c, f a b c d, and so on?
You can do something similar without type classes, as I learned from
http://www.cs.uu.nl/wiki/Afp/Assignments#Assignment_2 :
begin cont = cont (return ())
a m cont = cont (m >> putStrLn "a")
b m cont = cont (m >> putStrLn "b")
c m cont = cont (m >> putStrLn "c")
end m = m
main = begin a b c a b a end
Cheers,
Bertram
More information about the Haskell-Cafe
mailing list