module Stripes where -- library imports import GHC.Base import GHC.Int import GHC.Float import Pan stripesImage :: ImageC stripesImage (Pt _ y) = if even' (floor' y) then red else white effect :: UI DisplayFun effect = imageToDisplayFun stripesImage floor' :: Float -> Int floor' (F# f) = case ltFloat# f 0.0# of True -> I# ((float2Int# f) -# 1#) _ -> I# (float2Int# f) even' :: Int -> Bool even' (I# n) = case modInt# n 2# of 0# -> True _ -> False