-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Embedded BASIC -- -- A simplified version of the original BASIC embedded in Haskell. @package BASIC @version 0.1.1.0 -- | A simplified embedded version of original BASIC. Some things work, -- some things just give utterly mysterious type errors. -- -- Beware, this is just a fun weekend hack. module Language.BASIC getBASIC :: BASIC -> [Expr ()] type BASIC = Expr () data PRINT PRINT :: PRINT data END END :: END STOP :: END RETURN :: END REM :: END data LET LET :: LET data GOTO GOTO :: GOTO GOSUB :: GOTO data IF IF :: IF data THEN THEN :: THEN data INPUT INPUT :: INPUT data FOR FOR :: FOR data TO TO :: TO data NEXT NEXT :: NEXT data Expr a (:=) :: Expr a -> Expr a -> Expr a (<>) :: Expr a -> Expr a -> Expr a (==) :: Expr a -> Expr a -> Expr a (<) :: Expr a -> Expr a -> Expr a (>) :: Expr a -> Expr a -> Expr a (<=) :: Expr a -> Expr a -> Expr a (>=) :: Expr a -> Expr a -> Expr a (^) :: Expr a -> Expr a -> Expr a data Expr a Cmd :: Integer -> Command -> [Expr a] -> Expr a Str :: String -> Expr a Dbl :: Double -> Expr a Label :: Integer -> Expr a Binop :: (Expr a) -> String -> (Expr a) -> Expr a (:=) :: Expr a -> Expr a -> Expr a RND :: (Expr a) -> Expr a INT :: (Expr a) -> Expr a SGN :: (Expr a) -> Expr a Var :: Expr a I :: Expr a S :: Expr a X :: Expr a Y :: Expr a Z :: Expr a None :: Expr a cmdLabel :: Expr a -> Integer data Command Print :: Command End :: Command Let :: Command Goto :: Command Gosub :: Command Return :: Command If :: Command Input :: Command For :: Command Next :: Command Rem :: Command type BASIC = Expr () -- | Run a BASIC program with an interpreter. runBASIC :: BASIC -> IO () -- | Run a BASIC program with a compiler. runBASIC' :: BASIC -> IO ()