-- 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.2.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 SIN :: (Expr a) -> Expr a COS :: (Expr a) -> Expr a TAN :: (Expr a) -> Expr a ATN :: (Expr a) -> Expr a EXP :: (Expr a) -> Expr a LOG :: (Expr a) -> Expr a RND :: (Expr a) -> Expr a INT :: (Expr a) -> Expr a SGN :: (Expr a) -> Expr a ABS :: (Expr a) -> Expr a SQR :: (Expr a) -> Expr a Var :: Expr a A :: Expr a B :: Expr a C :: Expr a D :: Expr a E :: Expr a F :: Expr a G :: Expr a H :: Expr a I :: Expr a J :: Expr a K :: Expr a L :: Expr a M :: Expr a N :: Expr a O :: Expr a P :: Expr a Q :: Expr a R :: Expr a S :: Expr a T :: Expr a U :: Expr a V :: Expr a W :: 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 ()