From svenpanne at gmail.com Thu Oct 1 16:54:42 2015 From: svenpanne at gmail.com (Sven Panne) Date: Thu, 1 Oct 2015 18:54:42 +0200 Subject: [HOpenGL] [Haskell-cafe] Merging the OpenGLRaw and gl packages In-Reply-To: References: Message-ID: 2015-10-01 11:01 GMT+02:00 Oliver Charles : > [...] However, it's a lot more significant if you want to do something > like: > > foo x = doSomething (case x of ...) > > Without pattern synonyms, you either have > > foo x = doSomething x' > where x' | x == ... = ... > > or > > {-# LANGUAGE MultiWayIf #-} > > foo x = doSomething (if | x == ... -> ...) > Or simply in plain old Haskell (basically the desugaring of the multi-way-if): foo x = doSomething (case () of _ | x == gl_BAR -> expr1 | x == gl_BAZ -> expr2 | otherwise -> expr3) Compared to: foo x = doSomething (case x of GL_BAR -> expr1 GL_BAZ -> expr2 _ .> expr3) it doesn't really look *that* much different IMHO, given the high price one has to pay for a tiny improvement in readability. But that's my personal, more conservative view of things, and I'm here to see what other people prefer.Alas, up to now, this is not very conclusive... :-/ -------------- next part -------------- An HTML attachment was scrubbed... URL: