This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- see also | |
-- http://apfelmus.nfshost.com/blog/2012/06/07-forklift.html | |
module ForkLift where | |
import Control.Concurrent | |
import Control.Monad | |
import Control.Monad.IO.Class | |
import Control.Monad.Trans.State |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- http://www.reddit.com/r/haskell/comments/rbgvz/conduits_vs_pipes_using_void_as_an_input_or/ | |
import Control.Monad | |
data Pipe m i o r = | |
NeedInput (i -> Pipe m i o r) (Pipe m () o r) | |
| HaveOutput (Pipe m i o r) (m ()) o | |
| Finished (Maybe i) r | |
| PipeM (m (Pipe m i o r)) (m r) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Exception | |
import qualified Sound.SC3 as SC | |
-- Haskell version | |
incorrectPan = withSuperCollider $ do | |
SC.audition $ SC.out 0 $ | |
0.2* SC.balance2 (osc 220) (osc 220) mod (SC.constant 1) | |
getChar | |
where | |
osc freq = SC.sinOsc SC.AR (SC.constant freq) (SC.constant 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{----------------------------------------------------------------------------- | |
Re: Space-efficient, composable list transformers | |
A version of ListTo | |
that can handle lazy results and sequential compositon. | |
See http://article.gmane.org/gmane.comp.lang.haskell.cafe/95027 | |
and follow-up discussion. | |
------------------------------------------------------------------------------} | |
{-# LANGUAGE GADTs #-} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{----------------------------------------------------------------------------- | |
Re: Reifying case expressions [on lists] | |
A version of ListTo that can handle lazy results. | |
See http://article.gmane.org/gmane.comp.lang.haskell.cafe/94953 | |
and follow-up discussion. | |
------------------------------------------------------------------------------} | |
{-# LANGUAGE GADTs #-} | |
module ListTo (ListTo, caseOf, interpret, idL, takeL, andL, testId, testTake, testAnd) where |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Graphics.UI.WX | |
main = start $ do | |
-- create widgets | |
f <- frame [ text := "Example" ] | |
b <- button f [ text := "Test" ] | |
e <- entry f [ text := "1" ] | |
status <- staticText f [ size := sz 40 20 ] | |
-- populate initial values |
NewerOlder