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. --- Data/ByteStringBuilder.hs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Data/ByteStringBuilder.hs') diff --git a/Data/ByteStringBuilder.hs b/Data/ByteStringBuilder.hs index 859d710..6f0222e 100644 --- a/Data/ByteStringBuilder.hs +++ b/Data/ByteStringBuilder.hs @@ -25,8 +25,18 @@ putB = put . BSL.singleton runBuilder :: Builder -> ByteString runBuilder (ByteStringBuilder bs _) = bs +instance Functor ByteStringBuilder where + fmap f bb = bb >>= (return . f) + +instance Applicative ByteStringBuilder where + (<*>) afn aa = do + fn <- afn + a <- aa + return (fn a) + + pure = return + instance Monad ByteStringBuilder where ByteStringBuilder a _ >> ByteStringBuilder b c = ByteStringBuilder (a `append` b) c a@(ByteStringBuilder _ b) >>= func = a >> func b return = ByteStringBuilder BSL.empty - fail = error -- cgit