[Haskell-cafe] Proposal: Infix expression keyword: -XInfixExpressions

Joachim Breitner mail at joachim-breitner.de
Fri Feb 20 13:02:34 UTC 2015


Hi,

Am Donnerstag, den 19.02.2015, 16:42 +0100 schrieb Christopher Done:
> * Some things are foldable cleanly like monoids, so you can just
> mconcat [x,y,z] and that'll be inlined (I think).

the sufficiently smart compiler might do that, but not this one (GHC
7.8.4). Neither in the generic case of

foo :: Monoid a => a -> a -> a -> a -> a -> a
foo a b c d e = mconcat [a,b,c,d,e]

nor the monomophic case of 

foo :: String -> String -> String -> String -> String -> String
foo a b c d e = mconcat [a,b,c,d,e]



BTW, would your proposal extend to types? i.e.

foo :: infix (->) String String String String String
foo a b c d e = mconcat [a,b,c,d,e]

Greetings,
Joachim

-- 
Joachim “nomeata” Breitner
  mail at joachim-breitner.dehttp://www.joachim-breitner.de/
  Jabber: nomeata at joachim-breitner.de  • GPG-Key: 0xF0FBF51F
  Debian Developer: nomeata at debian.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150220/52e45124/attachment.sig>


More information about the Haskell-Cafe mailing list