Re: [Haskell-cafe] ARM back end?

2007-12-09 Thread Andreas Farre
On Mon, 03 Dec 2007 18:24:10 +0100, Mathieu Boespflug [EMAIL PROTECTED]  
wrote:



On Nov 2, 2007 10:19 PM, nornagon [EMAIL PROTECTED] wrote:

On 03/11/2007, Greg Fitzgerald [EMAIL PROTECTED] wrote:
 Anybody know of an ARM back end for any of the Haskell compilers?


If there's an arm-eabi port somewhere, I might be able to get Haskell
code running on the Nintendo DS...


https://garage.maemo.org/projects/hugs/

Runs on my Nokia N800 which is arm-eabi based.

Mathieu


The DS is a bit peckish, but I did get hugs to run on it with devkitPro. I  
wrote about my experiences at my blog: www.closuretohome.com.


Cheers,
Andreas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] snd and tuples of various sizes...

2007-02-02 Thread Andreas Farre

Mattias Bengtsson wrote:
 On Thu, 2007-02-01 at 21:01 -1000, Tim Newsham wrote:
 instance Second [a] a where
  snd [] = error don't got none
  snd (x:y:xs) = y

 Would'nt that instance mean this:
   snd [] produces error
   snd [x] gives []


 I'd implement it something like this (if this works?):

 instance Second [a] (Maybe a) where
  snd [] = Nothing
  snd [x] = Nothing
  snd (x:y:xs) = Just y

And while we're re-implementing the Prelude with MPTC:

class Currying a b | a - b where
 curryC   :: a - b
 uncurryC :: b - a

instance Currying ((a, b) - c) (a - b - c) where
 curryC = curry
 uncurryC = uncurry

instance Currying ((a, b, c) - d) (a - b - c - d) where
 curryC f a b c = f (a, b, c)
 uncurryC f (a, b, c) = f a b c

instance Currying ((a, b, c, d) - e) (a - b - c - d - e) where
 curryC f a b c d = f (a, b, c, d)
 uncurryC f (a, b, c, d) = f a b c d

instance Currying ((a, b, c, d, e) - f) (a - b - c - d - e - f) where
 curryC f a b c d e = f (a, b, c, d, e)
 uncurryC f (a, b, c, d, e) = f a b c d e

...

Andreas

-- 
some cannot be created more equal than others

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: new Haskell hacker seeking peer review

2005-02-23 Thread Andreas Farre

Bjorn Bringert said:

 Or why not the two characters shorter, but much less readable:

 pointsFreeCat' = getArgs = mapM_ ((= putStr) . readFile)

 or maybe:

 pointsFreeCat'' = getArgs = mapM_ (putStr . readFile)

 (.) :: (b - IO c) - (a - IO b) - a - IO c
 (.) = (.) . flip (=)

 Is (.) in the standard libs? If not, should it be? I'm sure there is a
 shorter definition of (.) that I haven't thought of.

 /Bjorn

Or even:

k :: Monad m = (a - m b) - Kleisli m a b
k = Kleisli

runKleisli :: Monad m = Kleisli m a b - (a - m b)
runKleisli (Kleisli f) = f

cat :: IO ()
cat = getArgs = (runKleisli $ (k $ mapM readFile)  (k $ mapM_ putStr))

after noticing that (.) is pretty similar to () when we lift (a - IO
b) to (Kleisli IO a b). It is pretty disappointing that runKleisli isn't
defined so that I can be cool and completely point free too ;)

/Andreas

-- 
some cannot be created more equal than others

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe