efficient, because you're using lists, and
attempting to index into them and measure their lengths. Perhaps a different
data structure is in order.
Thanks
Tom Davie
On 3 Apr 2013, at 17:38, Lone Wolf amslonew...@gmail.com wrote:
http://stackoverflow.com/questions/8940470/algorithm-for-finding
Prelude import Data.Ratio
Prelude Data.Ratio 93 % 10 - (2 * 9 % 2)
3 % 10
Floating point sucks, avoid it if you can.
Thanks
Tom Davie
On 16 Jan 2013, at 13:25, ivan dragolov i...@dragolov.net wrote:
9.3 - (2 * 4.5) = 0.3007
I expected 0.3
?
--
Иван Драголов
Aside from Neil's point about rank-2 polymorphism, you can of course just
parameterise your NumHolder type...
data Num a = NumHolder a = NumHolder a
instance Show a = Show NumHolder a where
show (NumHolder x) = show x
instance Functor NumHolder where
fmap f (NumHolder a) = NumHolder (f a)
On Tue, Dec 29, 2009 at 2:47 PM, pbrowne patrick.bro...@comp.dit.ie wrote:
Hi,
I am studying the underlying semantics behind Haskell and to what degree
those semantics are actually implemented. I need to clarify what a *type
synonym* actual means in relation to Haskell's logic (or formal
This isn't quite what you're asking for, but by using the applicative
interface to parsers, you need do little more than spell out what your AST
looks like:
import Control.Applicative
import Control.Applicative.Infix
data Equation = String :=: Expression
data Expression = EApp fun arg | EInt Int
Lazy evaluation is an evaluation strategy that gives non-strict semantics.
A lazy function I'm not sure how to define. It may be lazy language meaning
a function which is non-strict in one of it's arguments.
Bob
On Sun, Dec 27, 2009 at 1:16 PM, michael rice nowg...@yahoo.com wrote:
I've seen
Non-strictness is not necessary for purity, but it sure gives you some nice
properties... Take for example
const x y = x
It would be really nice for this function to have the property always
results in x no matter what you give it as it's second argument. But for a
language which is strict, all
I have to admit, it's just one criterion too much for me. I can manage to
satisfy all of them except for willing to work in Manhattan.
Bob
On Tue, Dec 8, 2009 at 5:54 PM, Tom Tobin korp...@korpios.com wrote:
On Tue, Dec 8, 2009 at 11:09 AM, siki ga...@karamaan.com wrote:
I've posted this
On 10/31/09, Heinrich Apfelmus apfel...@quantentunnel.de wrote:
The only possible monad instance would be
return x = Const mempty
fmap f (Const b) = Const b
join (Const b) = Const b
Your join doesn't seem to have the right type... Unless I'm missing something.
Bob
On 10/31/09, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote:
After all, I never think OO as an oppsite way to all other things. The
idea is so general that if you say I cannot use it in Haskell at all,
that would make me feel weird. The only difference between languages
is, some are
Of note, there is a sensible monad instance for zip lists which I *think*
agrees with the Applicative one, I don't know why they're not monads:
instance Monad (ZipList a) where
return = Ziplist . return
join (ZipList []) = ZipList []
join (ZipList (a:as)) = zlHead a `zlCons` join (map
On Fri, Oct 30, 2009 at 5:59 PM, Luke Palmer lrpal...@gmail.com wrote:
On Fri, Oct 30, 2009 at 10:39 AM, Tom Davie tom.da...@gmail.com wrote:
Of note, there is a sensible monad instance for zip lists which I *think*
agrees with the Applicative one, I don't know why they're not monads
to install ghc and it's dependancies.
Hope this helps anyone digging in the archives for a solution.
Tom Davie
On Thu, 2 Sep 2004 22:59:59 -0400, Gregory Wright [EMAIL PROTECTED] wrote:
Hi Tom,
You might try building ghc using darwinports
(darwinports.opendarwin.org).
It works under both
13 matches
Mail list logo