MFlow  Create and maintain dynamic Web applications as easy and fast as console applications
Thou shall not write request handlers
 This release: 11/06/2014. (@agocorona) <>< . issues & bugs .  Mflow Source code,     source code of this site


Either you use the <<  operator to insert a string in a tag or use OverloadedStrings. But not both.


tag << b  = a $ toMarkup b

when b is a string, and OverloadedStrings extension is active, the compiler
donĀ“t know which type the string is, since it is overloaded, that is,

So it is valid:

wlink () << p << "this is a string with a link"

and also is valid:

{-# LANGUAGE  OverloadedStrings #-}

wlink  () << p "this is a string with a link"


wlink  ()  (p "this is a string with a link")

the << operator is slightly redundant in the last case (since p is already of type Markup), but the resultant syntax is better.

But the first expression will produce an error when OverloadedStrings is active.

In the second expression , The OverloadedString expression apply  toMarkup  to lift the string to the Markup type automatically. 

In the first expression, the operator << do it.

comments powered by Disqus