From a61b977aee80c3ce3aa6e27335eb9ad4e92ee8af Mon Sep 17 00:00:00 2001 From: Denis Buzdalov Date: Wed, 4 Nov 2020 11:41:12 +0300 Subject: [PATCH] Arduino-based `IO` operations were abstracted over `HasIO`. --- Blink.idr | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Blink.idr b/Blink.idr index d71c2ba..bef628a 100644 --- a/Blink.idr +++ b/Blink.idr @@ -9,25 +9,25 @@ infixr 9 ... %foreign "C:digitalWrite,libarduino" prim_digitalWrite : Int -> Int -> PrimIO Unit -digitalWrite : Int -> Int -> IO Unit +digitalWrite : HasIO io => Int -> Int -> io Unit digitalWrite = primIO ... prim_digitalWrite %foreign "C:pinMode,libarduino" prim_pinMode : Int -> Int -> PrimIO Unit -pinMode : Int -> Int -> IO Unit +pinMode : HasIO io => Int -> Int -> io Unit pinMode = primIO ... prim_pinMode %foreign "C:delay,libarduino" prim_delay : Int -> PrimIO Unit -delay : Int -> IO Unit +delay : HasIO io => Int -> io Unit delay = primIO . prim_delay forever : Monad f => f a -> f b forever x = do x; forever x -blink : Int -> Int -> IO () +blink : HasIO io => Int -> Int -> io () blink pin t = do digitalWrite pin 1 delay t digitalWrite pin 0