packages feed

freesect-0.0.5: S14.hs

  {- # LANGUAGE FreeSections #-}  -- with GHC's -F you cannot...

  module S14(main) where

  import Char(ord)
  import List(intersperse)

  data D = D Int String

  main = printList $ zipWith _[ f (__,b) $ D __ d ]_ as cs
    where
       f :: (Char,Float) -> D -> String
       f (a,b) (D x y) = d ++ ( show ( b * fromIntegral (ord a + x) ) )
       as = take 20 ['a','b'..]
       cs = take 20 [1,3..]
       b = 1.7
       d = "pleasant"
       printList = putStrLn . concat . intersperse "\n"