From 11fca081b1241e1915f357fa40baa3e97aceb823 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Sat, 3 Dec 2022 01:03:52 -0700 Subject: Start reviving this ancient project. (It's pretty cool). Got it to compile using Stack. Skybox works, but nothing else really does. I think this is a problem with how the program is interpreting the surface pixels when calculating the map terrain and elevation. I think some TLC is in order. --- TileShow.hs | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 TileShow.hs (limited to 'TileShow.hs') diff --git a/TileShow.hs b/TileShow.hs deleted file mode 100644 index dd353dc..0000000 --- a/TileShow.hs +++ /dev/null @@ -1,27 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} - -module TileShow where -import Language.Haskell.TH - -makeShow t = do - TyConI (DataD _ _ _ constructors _) <- reify t - -- Make `show` clause for one constructor: - -- show (A x1 x2) = "A "++show x1++" "++show x2 - let showClause (NormalC name fields) = do - -- Name of constructor, i.e. "A". Will become string literal in generated code - let constructorName = [(head $ nameBase name)] - -- Generate function clause for one constructor - clause [conP name []] -- (A x1 x2) - (normalB [| constructorName |]) [] -- "A "++show x1++" "++show x2 - -- Make body for function `show`: - -- show (A x1 x2) = "A "++show x1++" "++show x2 - -- show (B x1) = "B "++show x1 - -- show C = "C" - showbody <- mapM showClause constructors - -- Generate template instance declaration and then replace - -- type name (T1) and function body (\x -> "text") with our data - d <- [d| instance Show String where - show _x = "text" - |] - let [InstanceD [] (AppT showt (ConT _T1)) [FunD showf _text]] = d - return [InstanceD [] (AppT showt (ConT t )) [FunD showf showbody]] -- cgit