map :: (a -> b) -> [a] -> [b]
map takes a function and transforms a list of a's to b's.
map succ [1,2,3]
==> [succ 1, succ 2, succ 3]
==> [2, 3, 4]
In general,
map f :: [a] -> [b]
where a is domain-type of f and b is image-type of f (f :: a -> b).
map map [x, y, z]
==> [map x, map y, map z]
so
Did you print it? I'm using same code with ghc --make -O2 and it
takes forever to finish.
On Wed, Jan 28, 2009 at 8:06 PM, Duncan Coutts
wrote:
> On Wed, 2009-01-28 at 16:42 -0800, drblanco wrote:
>
>> I do already have the number I wanted, but was wondering how this could be
>> made faster, or
The following code compiles fine on my ghci
ghci> :l sexpr.hs
[1 of 1] Compiling Sexpr( sexpr.hs, interpreted )
Ok, modules loaded: Sexpr.
$ ghci --version
The Glorious Glasgow Haskell Compilation System, version 6.8.2
-- code
{-# LANGUAGE TypeSynonymInstances #-}
module Sexp
Sorry it won't work because list should be homogeneous.
I think your myFunc is standard.
This guy names it "thread":
http://alaska-kamtchatka.blogspot.com/2009/01/essence-of-concatenative-languages.html
On Fri, Jan 16, 2009 at 10:32 AM, sam lee wrote:
> @pl myFunc f (a,b) (c,
@pl myFunc f (a,b) (c,d) = (f a c, f b d)
myFunc = (`ap` snd) . (. fst) . flip flip snd . ((flip . (ap .))
.) . flip flip fst . ((flip . ((.) .)) .) . (flip =<< (((.) . flip . (((.) .
(,)) .)) .))
why not use zipWith?
[a,b] `g` [c,d] where g = zipWith f
2009/1/16 Andrew Wagner
> I've been p
http://i35.tinypic.com/mjon83.png
used this: http://www.simwebsol.com/ImageTool/Default.aspx
2008/12/14 George Pollard :
> ?
>
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
_
I use my type checking monad, which is separate from Parsec's monad.
So, I can't think of a way to type check during parsing in Parsec's monad.
Anyways, this is what I did:
data Expr = ... | At SourcePos Expr
SourcePos is from Parsec.
Basically, my parse actions will return (At pos e).
And I p
On Sun, Dec 7, 2008 at 4:23 AM, Bit Connor <[EMAIL PROTECTED]> wrote:
> Did you follow the instructions described in the WIN32 file?
>
> On Sat, Dec 6, 2008 at 2:05 PM, sam lee <[EMAIL PROTECTED]> wrote:
>> Hi.
>>
>> I am using Windows Vista.
>> I insta
instead do the
> initialization itself; see the rest of that FAQ question.
>
> In fact, the "MACOSX" readme file in the Haskell SDL binding talks
> about exactly this problem.
>
> -- ryan
>
> On Sat, Dec 6, 2008 at 2:05 PM, sam lee <[EMAIL PROTECTED]> wrote:
>
Hi.
I am using Windows Vista.
I installed the following:
- ghc 6.8.3 (using official Windows binary installer)
- MinGW (from http://nuwen.net/mingw.html)
- SDL binding (from
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/SDL)
I am trying to compile the following program:
module
I can't find document for System.Time .
But I can import System.Time . It's weird...
I can't find document for TimeDiff and related functions. I guess this
is all deprecated.
A related bug report: http://hackage.haskell.org/trac/ghc/ticket/2519
I would use Data.Time.Clock
Prelude> :m + Data.Tim
# is significant because it can be sh-bang line or pre-processor.
The only way I can think of is:
alias lhspp="sed 's/^#//'"
ghc --make -F -pgmF lhspp File.lhs
On Sat, Nov 29, 2008 at 10:07 PM, John MacFarlane <[EMAIL PROTECTED]> wrote:
> Can anyone explain why ghc does not treat the following
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HGL
or
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/soegtk
2008/11/24 Dmitri O.Kondratiev <[EMAIL PROTECTED]>:
> Please help, to locate in GHC distribution SOEGraphics library from
> Paul Hudak, book "The Haskell School of E
I haven't found multitrack audio recording applications written in
Haskell. These are usually written in C++ using Jack audio or ASIO.
This probably means that it is not a good idea to write real time
audio applications in Haskell at the moment.
So, probably avoid writing applications that use a hi
I think it's because + is left associative. and pattern matching is
top to bottom.
1 + 1 + 1 => (1 + 1) + 1 => found match: 1 + 1 = 3 => 3 + 1 => found
match: 3 + 1 = 3 => 3
On Thu, Sep 18, 2008 at 11:01 PM, Steven Shaw <[EMAIL PROTECTED]> wrote:
> 2008/9/19 Evan Laforge <[EMAIL PROTECTED]>
>> let
I can think of 2 ways.
> module Main where
>
> import Control.Monad.State
First, normal way:
> diff (now, old) = (now - old, now)
diff takes now and old and returns result (now - old) and modified old (now).
For example,
diff (diff (1,0))
==> diff (1 - 0, 1)
==> diff (1, 1)
==>
> tInfer :: MonadTypeInfer m => Expr -> m Type
> eval :: MonadEval m => Expr -> m Expr
That solves!
I should've left out type annotation.
On Mon, May 12, 2008 at 10:38 AM, Twan van Laarhoven <[EMAIL PROTECTED]> wrote:
> sam lee wrote:
>
>
>
Hi.
I want to compose two monads to build another monad where
computations of the two monads can be used inside.
I have:
- MonadTypeInfer : interface (class) for TypeInfer monad
- TypeInfer : a monad that has Map String Type (association of names and types)
- TypeInferT : transformer of above mo
18 matches
Mail list logo