-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add prelude module, bump version, update example
- Loading branch information
Showing
6 changed files
with
59 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
{-# LANGUAGE OverloadedStrings #-} | ||
module Main where | ||
|
||
import Control.Monad | ||
import qualified Data.Text.Lazy.IO as T | ||
import Data.Word | ||
import Lazyboy | ||
import Lazyboy.Prelude | ||
import Lazyboy.Target.ASM | ||
import Prelude hiding ((&&), (/=), (<), (==), (>), (||)) | ||
|
||
main :: IO () | ||
main = rom >>= T.putStrLn | ||
where rom = compileROM $ do | ||
byte A 0xDE | ||
byte B 0xDE | ||
if' ((A `equalTo` (0xDE :: Word8)) `Lazyboy.and` (A `equalTo` B)) $ do | ||
if' ((A == (0xDE :: Word8)) && (A == B)) $ do | ||
write (Address wram0) 0xDE | ||
freeze | ||
freeze |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: lazyboy | ||
version: 0.2.1.1 | ||
version: 0.2.2.0 | ||
github: "ix/lazyboy" | ||
license: BSD3 | ||
author: "Rose" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{-| | ||
Module : Lazyboy.Prelude | ||
Description : Convenience aliases for Lazyboy which share names with Haskell's Prelude. | ||
Copyright : (c) Rose 2019 | ||
License : BSD3 | ||
Maintainer : rose@lain.org.uk | ||
Stability : experimental | ||
Portability : POSIX | ||
This module defines aliases for Lazyboy functions which share names with entities in Haskell's | ||
Prelude library. These are presented for the user to optionally import. | ||
-} | ||
|
||
module Lazyboy.Prelude where | ||
|
||
import Lazyboy (Condition, Lazyboy, Comparable) | ||
import qualified Lazyboy.Control as Lazyboy | ||
|
||
-- | Overload the == (equality) operator for use in Lazyboy. | ||
(==) :: Comparable a b => a -> b -> Lazyboy Condition | ||
(==) = Lazyboy.equalTo | ||
|
||
-- | Overload the /= (inequality) operator for use in Lazyboy. | ||
(/=) :: Comparable a b => a -> b -> Lazyboy Condition | ||
(/=) = Lazyboy.notEqualTo | ||
|
||
-- | Overload the > (greater than) operator for use in Lazyboy. | ||
(>) :: Comparable a b => a -> b -> Lazyboy Condition | ||
(>) = Lazyboy.greaterThan | ||
|
||
-- | Overload the < (lesser than) operator for use in Lazyboy. | ||
(<) :: Comparable a b => a -> b -> Lazyboy Condition | ||
(<) = Lazyboy.lessThan | ||
|
||
-- | Overload the && (AND) operator for use in Lazyboy. | ||
(&&) :: Lazyboy Condition -> Lazyboy Condition -> Lazyboy Condition | ||
(&&) = Lazyboy.and | ||
|
||
-- | Overload the || (OR) operator for use in Lazyboy. | ||
(||) :: Lazyboy Condition -> Lazyboy Condition -> Lazyboy Condition | ||
(||) = Lazyboy.or |