File: Cast.hs

package info (click to toggle)
haskell-copilot 4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 164 kB
  • sloc: haskell: 631; makefile: 6
file content (27 lines) | stat: -rw-r--r-- 417 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
-- Copyright © 2019 National Institute of Aerospace / Galois, Inc.

-- | Examples of casting types.

{-# LANGUAGE RebindableSyntax #-}

module Main where

import Language.Copilot

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]

main :: IO ()
main = interpret 30 spec