Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (22 sloc) 0.685 kB
--------------------------------------------------------------------------------
-- Copyright © 2011 National Institute of Aerospace / Galois, Inc.
--------------------------------------------------------------------------------
{-# LANGUAGE RebindableSyntax #-}
-- Examples of casting types.
module Cast ( castEx ) where
import Language.Copilot hiding (even, odd)
import Copilot.Compile.C99
b :: Stream Bool
b = [True] ++ not b
i :: Stream Int8
i = cast b
x :: Stream Word16
x = [0] ++ x + 1
y :: Stream Int32
y = 1 + cast x
spec :: Spec
spec = trigger "trigger" true [arg y, arg i]
castEx :: IO ()
castEx = do
interpret 10 spec
reify spec >>= compile defaultParams
Jump to Line
Something went wrong with that request. Please try again.