[Haskell-cafe] Announcement: Bang, a drum DSL for Haskell
tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Wed Jun 11 10:29:31 UTC 2014
On Wed, Jun 11, 2014 at 01:25:48AM +0200, Bertram Felgenhauer wrote:
> 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
This is fantastic!
More information about the Haskell-Cafe