BASIC-0.1.1.0: Embedded BASIC

Language.BASIC

Description

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.

Synopsis

Documentation

data PRINT Source

Constructors

PRINT 

Instances

Eq (PRINT -> t -> Expr a) 
Eq (PRINT -> Expr a -> Expr b) 
(Show t, Typeable t) => Num (PRINT -> t -> Expr a) 
Num (PRINT -> Expr a -> Expr b) 
Show (PRINT -> t -> Expr a) 
Show (PRINT -> Expr a -> Expr b) 

data END Source

Constructors

END 
STOP 
RETURN 
REM 

Instances

Eq END 
Eq (END -> Expr a) 
Num (END -> Expr a) 
Show (END -> Expr a) 

data LET Source

Constructors

LET 

Instances

Eq (LET -> Expr a -> Expr b) 
Num (LET -> Expr a -> Expr b) 
Show (LET -> Expr a -> Expr b) 

data GOTO Source

Constructors

GOTO 
GOSUB 

Instances

Eq GOTO 
Eq (GOTO -> t -> Expr a) 
Integral t => Num (GOTO -> t -> Expr a) 
Show (GOTO -> t -> Expr a) 

data IF Source

Constructors

IF 

Instances

Eq (IF -> Expr a -> Expr b) 
Num (IF -> Expr a -> Expr b) 
Show (IF -> Expr a -> Expr b) 

data THEN Source

Constructors

THEN 

Instances

Eq (THEN -> t -> Expr a) 
Integral t => Num (THEN -> t -> Expr a) 
Show (THEN -> t -> Expr a) 

data INPUT Source

Constructors

INPUT 

Instances

Eq (INPUT -> Expr a -> Expr b) 
Num (INPUT -> Expr a -> Expr b) 
Show (INPUT -> Expr a -> Expr b) 

data FOR Source

Constructors

FOR 

Instances

Eq (FOR -> Expr a -> Expr b) 
Num (FOR -> Expr a -> Expr b) 
Show (FOR -> Expr a -> Expr b) 

data TO Source

Constructors

TO 

Instances

Eq (TO -> t -> Expr a) 
(Show t, Typeable t) => Fractional (TO -> t -> Expr a) 
(Show t, Typeable t) => Num (TO -> t -> Expr a) 
Show (TO -> t -> Expr a) 

data NEXT Source

Constructors

NEXT 

Instances

Eq (NEXT -> Expr a -> Expr b) 
Num (NEXT -> Expr a -> Expr b) 
Show (NEXT -> Expr a -> Expr b) 

data Expr a Source

Constructors

(Expr a) := (Expr a) 

Instances

Monad Expr 
Typeable1 Expr 
Eq (Expr a) 
Fractional (Expr a) 
Num (Expr a) 
Ord (Expr a) 
Show (Expr a) 
IsString (Expr a) 
Eq (NEXT -> Expr a -> Expr b) 
Eq (TO -> t -> Expr a) 
Eq (FOR -> Expr a -> Expr b) 
Eq (INPUT -> Expr a -> Expr b) 
Eq (THEN -> t -> Expr a) 
Eq (IF -> Expr a -> Expr b) 
Eq (GOTO -> t -> Expr a) 
Eq (LET -> Expr a -> Expr b) 
Eq (END -> Expr a) 
Eq (PRINT -> t -> Expr a) 
Eq (PRINT -> Expr a -> Expr b) 
(Show t, Typeable t) => Fractional (TO -> t -> Expr a) 
Num (NEXT -> Expr a -> Expr b) 
(Show t, Typeable t) => Num (TO -> t -> Expr a) 
Num (FOR -> Expr a -> Expr b) 
Num (INPUT -> Expr a -> Expr b) 
Integral t => Num (THEN -> t -> Expr a) 
Num (IF -> Expr a -> Expr b) 
Integral t => Num (GOTO -> t -> Expr a) 
Num (LET -> Expr a -> Expr b) 
Num (END -> Expr a) 
(Show t, Typeable t) => Num (PRINT -> t -> Expr a) 
Num (PRINT -> Expr a -> Expr b) 
Show (NEXT -> Expr a -> Expr b) 
Show (TO -> t -> Expr a) 
Show (FOR -> Expr a -> Expr b) 
Show (INPUT -> Expr a -> Expr b) 
Show (THEN -> t -> Expr a) 
Show (IF -> Expr a -> Expr b) 
Show (GOTO -> t -> Expr a) 
Show (LET -> Expr a -> Expr b) 
Show (END -> Expr a) 
Show (PRINT -> t -> Expr a) 
Show (PRINT -> Expr a -> Expr b) 

(<>) :: Expr a -> Expr a -> Expr aSource

(==) :: Expr a -> Expr a -> Expr aSource

(<) :: Expr a -> Expr a -> Expr aSource

(>) :: Expr a -> Expr a -> Expr aSource

(<=) :: Expr a -> Expr a -> Expr aSource

(>=) :: Expr a -> Expr a -> Expr aSource

(^) :: Expr a -> Expr a -> Expr aSource

data Expr a Source

Constructors

Cmd Integer Command [Expr a] 
Str String 
Dbl Double 
Label Integer 
Binop (Expr a) String (Expr a) 
(Expr a) := (Expr a) 
RND (Expr a) 
INT (Expr a) 
SGN (Expr a) 
Var 
I 
S 
X 
Y 
Z 
None 

Instances

Monad Expr 
Typeable1 Expr 
Eq (Expr a) 
Fractional (Expr a) 
Num (Expr a) 
Ord (Expr a) 
Show (Expr a) 
IsString (Expr a) 
Eq (NEXT -> Expr a -> Expr b) 
Eq (TO -> t -> Expr a) 
Eq (FOR -> Expr a -> Expr b) 
Eq (INPUT -> Expr a -> Expr b) 
Eq (THEN -> t -> Expr a) 
Eq (IF -> Expr a -> Expr b) 
Eq (GOTO -> t -> Expr a) 
Eq (LET -> Expr a -> Expr b) 
Eq (END -> Expr a) 
Eq (PRINT -> t -> Expr a) 
Eq (PRINT -> Expr a -> Expr b) 
(Show t, Typeable t) => Fractional (TO -> t -> Expr a) 
Num (NEXT -> Expr a -> Expr b) 
(Show t, Typeable t) => Num (TO -> t -> Expr a) 
Num (FOR -> Expr a -> Expr b) 
Num (INPUT -> Expr a -> Expr b) 
Integral t => Num (THEN -> t -> Expr a) 
Num (IF -> Expr a -> Expr b) 
Integral t => Num (GOTO -> t -> Expr a) 
Num (LET -> Expr a -> Expr b) 
Num (END -> Expr a) 
(Show t, Typeable t) => Num (PRINT -> t -> Expr a) 
Num (PRINT -> Expr a -> Expr b) 
Show (NEXT -> Expr a -> Expr b) 
Show (TO -> t -> Expr a) 
Show (FOR -> Expr a -> Expr b) 
Show (INPUT -> Expr a -> Expr b) 
Show (THEN -> t -> Expr a) 
Show (IF -> Expr a -> Expr b) 
Show (GOTO -> t -> Expr a) 
Show (LET -> Expr a -> Expr b) 
Show (END -> Expr a) 
Show (PRINT -> t -> Expr a) 
Show (PRINT -> Expr a -> Expr b) 

runBASIC :: BASIC -> IO ()Source

Run a BASIC program with an interpreter.

runBASIC' :: BASIC -> IO ()Source

Run a BASIC program with a compiler.