on ced5261 help sign in
streamly/src/Streamly/Examples.hs
60 lines 1.6 kB history raw
1{-# LANGUAGE CPP #-}
2-- |
3-- Module : Streamly.Examples
4-- Copyright : (c) 2017 Harendra Kumar
5--
6-- License : BSD3
7-- Maintainer : streamly@composewell.com
8-- Stability : experimental
9-- Portability : GHC
10--
11-- To run these examples:
12--
13-- You need to build the library with the "examples" flag on e.g.
14-- @stack build --flag streamly:examples@. To include the SDL examples as well
15-- use @stack build --flag streamly:examples-sdl@. You will have to make sure
16-- that you have the SDL OS package installed on your system and the headers
17-- are visible to Haskell build tool.
18--
19-- You can directly evaluate the respective file and its main function using
20-- ghc, like this (this may not work when built with @examples-sdl@ flag):
21--
22-- @
23-- \$ stack ghc -- -e acidRainGame src\/Streamly\/Examples\/AcidRainGame.hs
24-- @
25--
26-- Alternatively, you can create a file calling the main function and compile
27-- it:
28--
29-- @
30-- \$ cat ex.hs
31-- import Streamly.Examples
32-- main = acidRainGame
33-- \$ stack ghc ex.hs
34-- @
35--
36-- Alternatively, you can just import "Streamly.Examples" and evaluate the
37-- respective function in GHCi.
38--
39module Streamly.Examples
40 (
41 -- Reactive Programming
42 acidRainGame
43#ifdef EXAMPLES_SDL
44 , circlingSquare
45#endif
47 -- Concurrent Programming
48 , listDirRecursive
49 , mergeSortedStreams
50 , searchEngineQuery
51 )
52where
54import Streamly.Examples.AcidRainGame
55#ifdef EXAMPLES_SDL
56import Streamly.Examples.CirclingSquare
57#endif
58import Streamly.Examples.ListDirRecursive
59import Streamly.Examples.MergeSortedStreams
60import Streamly.Examples.SearchEngineQuery