Hello all,
To coincide with Hac Phi 2010
(http://www.haskell.org/haskellwiki/Hac_%CF%86), the Snap team is happy
to announce the first public release of the Snap Framework, a simple and
fast Haskell web programming server and library for unix systems. For
installation instructions, documentation,
On Fri, May 21, 2010 at 8:59 PM, R J wrote:
> If I type "toEnum 5," the error I get is:
> :1:0:
> Ambiguous type variable `a' in the constraint:
> `Enum a' arising from a use of `toEnum' at :1:0-7
> Probable fix: add a type signature that fixes these type variable(s)
> *Main>
Here t
2010/5/21 R J :
> I'm trying to prove that (==) is reflexive, symmetric, and transitive over
> the Bools, given this definition:
> (==) :: Bool -> Bool -> Bool
> x == y = (x && y) || (not x && not y)
> My question is: are the proofs below for reflexivity
R J writes:
> I'd like to make "Day" an instance of class "Enum," but the definition
> of toEnum below seems to be completely wrong, because integers seem
> not permit pattern matching. How is toEnum defined? Thanks.
You could try using guards:
> toEnum x | x == 0= Sunday
>
2010/5/21 R J :
> I'd like to make "Day" an instance of class "Enum," but the definition of
> toEnum below seems to be completely wrong, because integers seem not permit
> pattern matching. How is toEnum defined? Thanks.
Hi,
What error are you getting when you try your class instance?
Thanks,
I'd like to make "Day" an instance of class "Enum," but the definition of
toEnum below seems to be completely wrong, because integers seem not permit
pattern matching. How is toEnum defined? Thanks.
data Day = Sunday | Monday
Have you tried freopen on stderr?
On Fri, May 21, 2010 at 8:43 AM, Phyx wrote:
> Hi,
> I tried that, setting it to (\_ _ _ _ -> return ()) and it still did the
> same, also tried setting it to undefined to see whether the code that's
> printing the error is using it, and it didn't crash
> So I a
I'm trying to prove that (==) is reflexive, symmetric, and transitive over the
Bools, given this definition:
(==) :: Bool -> Bool -> Boolx == y =
(x && y) || (not x && not y)
My question is: are the proofs below for reflexivity and symmetricity
rigoro
By the way, speaking of floating-point precision, is there a real reason why
haskell forces us to write :
foreign import ccall unsafe "math.h frexp" c_frexp::CDouble->(Ptr CInt)->IO ()
foreign import ccall unsafe "math.h ldexp" c_ldexp::CDouble->CInt->IO CDouble
ulp::Double->Double
ulp x=unsafeP
dvde:
> Dear Haskellers,
>
> I just want to share an observation. I had to convert a Double to a
> Float value in an inner loop of an application, and I used somethin like
> this:
>
> xf = (fromRational $ toRational xd) :: Float
>
> The program works on windows but it did not on OSX - it was to
On Friday 21 May 2010 22:06:43, Henning Thielemann wrote:
> On Fri, 21 May 2010, Daniel van den Eijkel wrote:
> > Dear Haskellers,
> >
> > I just want to share an observation. I had to convert a Double to a
> > Float value in an inner loop of an application, and I used somethin
> > like this:
> >
>
I see. And I changed the code, it works well. Thanks for that!
Daniel
Henning Thielemann schrieb:
On Fri, 21 May 2010, Daniel van den Eijkel wrote:
Dear Haskellers,
I just want to share an observation. I had to convert a Double to a
Float value in an inner loop of an application, and I use
On Fri, 21 May 2010, Daniel van den Eijkel wrote:
Dear Haskellers,
I just want to share an observation. I had to convert a Double to a Float
value in an inner loop of an application, and I used somethin like this:
xf = (fromRational $ toRational xd) :: Float
I think realToFrac is the func
Dear Haskellers,
I just want to share an observation. I had to convert a Double to a
Float value in an inner loop of an application, and I used somethin like
this:
xf = (fromRational $ toRational xd) :: Float
The program works on windows but it did not on OSX - it was too slow.
Now, after b
On Friday 21 May 2010 20:50:39, Anatoly Yakovenko wrote:
> anyone else seeing this behavior?
>
> anato...@anatolyy-linux ~ $ ghci
> GHCi, version 6.12.1: http://www.haskell.org/ghc/ :? for help
> Loading package ghc-prim ... linking ... done.
> Loading package integer-gmp ... linking ... done.
> L
anyone else seeing this behavior?
anato...@anatolyy-linux ~ $ ghci
GHCi, version 6.12.1: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ...
On Fri, May 21, 2010 at 12:30 PM, Jeremy Shaw wrote:
> Adding all the scoped type variable stuff does not seem to help. Alas,
> I can not figure out if this is a limitation of the type-checker, or
> something that is fundamentally impossible. Nor can I figure out how
> to work around the issue.
I
On Friday 21 May 2010 19:06:51, R J wrote:
> Why does the following, trivial code snippet below hang GHCi when I
> type"Scalene > Failure", and what's the fix?
For an Ord instance, you need to define at least one of compare and (<=) or
the other functions from the class won't work.
All methods h
From Prelude.hs:
class (Eq a) => Ord a where
compare :: a -> a -> Ordering
(<), (<=), (>), (>=) :: a -> a -> Bool
max, min :: a -> a -> a
compare x y = if x == y then EQ
-- NB: must be '<=' not '<' to validate the
--
2010/5/21 R J :
> Why does the following, trivial code snippet below hang GHCi when I type
> "Scalene > Failure", and what's the fix?
An instance of Ord must declare compare or (<=). You only defined (<),
so (>) is using the default definition. Here are the defaults:
compare x y = if x == y
On Fri, May 21, 2010 at 3:56 AM, Max Bolingbroke
wrote:
> On 21 May 2010 01:58, Carlos Camarao wrote:
>> But this type-correct program would become not typeable if
>> instances such as the ones referred to before (by Daniel Fischer)
>
> I was thinking this through, and the situation is more compl
Why does the following, trivial code snippet below hang GHCi when I
type"Scalene > Failure", and what's the fix?
data Triangle = Failure |
Equilateral | Isosceles
| Scalene
Hello,
I am trying to understand why I am getting an ambigious type variable error,
and what I can do to work around it. The problem is occurring while trying
to use syb-with-class, but I have stripped it down to it's bare essentials,
so the following code is self-contained, and does not require a
Hello!
Please advise haskell libraries similar to convert real-world HTML to
well-formed XML.
I need something similat to "HTML Tidy" library:
http://tidy.sourceforge.net/
Thanks!
Dmitri
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.h
Schedule and registration for the "Haskell in Leipzig"
meeting on June 4 are now on-line: http://www.iba-cg.de/hal5.html
It's our fifth meeting, and here are five good reasons to go:
* learn Haskell:
attend tutorials for beginners
* get first-hand information:
authors of Leksah, HXT, Ha
Hi Max.
Excerpts from Max Bolingbroke's message of Sex Mai 21 04:56:51 -0300 2010:
(...)
> (Incidentally, the link to your paper is broken, so I haven't actually
> been able to read it, sorry!)
It was easy to find it on google.
http://www.dcc.ufmg.br/~camarao/CT/solution-to-mptc-dilemma.pdf
Gre
Hi,
I tried that, setting it to (\_ _ _ _ -> return ()) and it still did the
same, also tried setting it to undefined to see whether the code that's
printing the error is using it, and it didn't crash
So I assume it's not.
---
*VsxParser> getModInfo True
"C:\\Users\\Phyx\\AppData\\Local\\T
Hello,
On Tue, May 18, 2010 at 04:47:50PM -0700, Dan Weston wrote:
> > Unifying those two types by hand, I get:
> >
> > P (A t -> B a)
> > ~> P (B a)
>
> Maybe the problem is that type families (and associated types, their
> class cousins) are not injective: P x ~ P y does not imply that x
You could try changing the log_action[1] member of the DynFlags. A
while ago I turned most printed errors into some form of error
message, but I wouldn't be surprised if I missed some places. All
output should go through log_action, though, so try changing that to
intercept any output.
[1]:
htt
Google translation:
> The office of our company is located in Nice - the heart of the
> Riviera, that gives us an immediate opportunity to offer villas
> for rent and sale in all their diversity, as well as guidance to
> our clients on the most interesting and important events in the
> rich cultura
Офис нашей компании находится в Ницце - в самом сердце Французской Ривьеры,
что дает нам непосредственную возможность предложить виллы для аренды и
продажи во всем их многообразии, а также сориентировать наших клиентов на
самые интересные и значимые мероприятия в богатой культурной и светской
жизни
Hi Roly,
> I'm looking for a simple way to rewrite strings according to simple
> composable rules like:
>
> replace "_" by "\\(\\hole\\)"
> replace "-n" where n matches an integer by "^{n}"
>
> so that I can import some pretty-printed output into a LaTeX alltt
> environment. I'm guessing that this
> ... to rewrite strings according to simple composable rules like ...
more often than not, regexp/replace is a hack to avoid the "real thing"
(parse -> AST -> transform -> AST' -> print).
such hacks tend to grow into something that is definitely not composable.
but, you can be a hero ... http:
On 21 May 2010 01:58, Carlos Camarao wrote:
> But this type-correct program would become not typeable if
> instances such as the ones referred to before (by Daniel Fischer)
I was thinking this through, and the situation is more complex than I
had thought.
It seems that single param type classes
Hi Evan
EHC - Essential Haskell Compiler - is the 'family of compilers' that
UHC - Utrecht Haskell Compiler - is instance one of. The EHC family
starts with a simple Haskell subset and adds features building up to
(almost) Haskell98 for UHC and extended Haskell for some of the EHC
variations. This
35 matches
Mail list logo