Mayan numerals: Difference between revisions

Content added Content deleted
(→‎{{header|Haskell}}: Pruned out liftA2 import (used <$> ... <*> instead))
Line 605: Line 605:
<lang haskell>import Data.List (intercalate, transpose)
<lang haskell>import Data.List (intercalate, transpose)
import qualified Data.Map.Strict as M
import qualified Data.Map.Strict as M
import Control.Applicative (liftA2)
import Control.Monad (join)
import Control.Monad (join)
import Data.Maybe (maybe)
import Data.Maybe (maybe)
Line 631: Line 630:
mayanFramed =
mayanFramed =
("Mayan " ++) .
("Mayan " ++) .
((++) <$> show <*>
liftA2
(++)
((":\n\n" ++) .
show
wikiTable
((":\n\n" ++) .
(M.fromList
wikiTable
[ ( "style"
(M.fromList
, join
[ ( "style"
[ "text-align:center;"
, concat
, "background-color:#F0EDDE;"
[ "text-align:center;"
, "color:#605B4B;"
, "background-color:#F0EDDE;"
, "border:2px solid silver;"
, "color:#605B4B;"
])
, "border:2px solid silver;"
, ("colwidth", "3em;")
])
]) .
mayanGlyph))
, ("colwidth", "3em;")
]) .
mayanGlyph)


mayaZero, mayaOne :: Char
mayaZero, mayaOne :: Char