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@gmail.com (@agocorona) <>< . issues & bugs .  Mflow Source code,     source code of this site




overloadedstrings

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



since

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,
polimorphic.

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"

or

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