fork download
  1. data Elem = Elem String {- | ... -} deriving (Eq, Show)
  2.  
  3. data Props t = Props { items :: [t], render :: t -> Elem }
  4.  
  5. component :: Props t -> Elem
  6. component _ = Elem ""
  7.  
  8. type FC p = p -> Elem
  9.  
  10. jsx :: FC p -> p -> Elem
  11. jsx f p = f p
  12.  
  13. main = print $ jsx component (Props ["one", "two"] (\item -> Elem (show (length item))))
Success #stdin #stdout 0.01s 5424KB
stdin
Standard input is empty
stdout
Elem ""