text: Yhc/API/Core
  From HaskellWiki
  Yhc Core is a way of dumping and using the internal representation of Yhc in an external project.
  1 Haddock Documentation
  2
  3.
  4 The Core output
  For an example of the Core output, taking the following program:
  head2 (x:xs) = x map2 f [] = [] map2 f (x:xs) = f x : map2 f xs test x = map2 head2 x
  Generates:
  Sample.head2 v220 = case v220 of (:) v221 v222 -> v221 _ -> Prelude.error Sample._LAMBDA228 Sample._LAMBDA228 = "Sample: Pattern match failure in function at 9:1-9:15." Sample.map2 v223 v224 = case v224 of [] -> [] (:) v225 v226 -> (:) (v223 v225) (Sample.map2 v223 v226) Sample.test v227 = Sample.map2 Sample.head2 v227
  Note that all names have been fully qualified, there are no infix operators, all pattern matches have been converted to case's.
  5 Some little samples
  5.1 Hello World, for Core
  The following snipet loads a Core file and prints it out.
  import Yhc.Core showFile x :: FilePath -> String showFile x = liftM show (loadCore x)
  5.2.
  5.3 SHOUT AT EVERYONE
  How do you change all strings and characters into uppercase?
  import Yhc.Core shout :: Core -> Core shout core = mapUnderCore f core where f (CoreChr x) = CoreChr (toUpper x) f (CoreStr x) = CoreStr (map toUpper x) f x = x
  5.4 $ filter is42 $ allCore func, n /= 0] is42 :: CoreExpr -> Bool is42 (CoreInt 42) = True is42 (CoreInteger 42) = True is42 _ = False
  6 See Also
  7 Users
  - Catch - Case Totality Checker for Haskell by Neil Mitchell. This takes Core as an input.
  - Dr Haskell - give hints to beginners about useful Haskell functions/idioms.