Skip to content

Instantly share code, notes, and snippets.

@schell
Last active December 19, 2015 00:59
Show Gist options
  • Save schell/5873085 to your computer and use it in GitHub Desktop.
Save schell/5873085 to your computer and use it in GitHub Desktop.
Using Reader to sequence a thing over a list functions to produce a list of things.
toTriangleRect :: Rectangle -> [GLfloat]
toTriangleRect (Rectangle (x,y) (w,h)) = concat [tl, bl, br, br, tl, tr]
where tl = [x,y]
tr = [x+w,y]
bl = [x,y+h]
br = [x+w,y+h]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment