2007/8/19, Daniel C. Bastos [EMAIL PROTECTED]:
Any help is appreciated.
I also had problem with this exercise. However this was more Haskell
newbie problem :)
If you're feeling lost you can always try google and come up with this
blog with solutions to exercises from this book. You should find
(*) Exercise 2.2
Define a function regularPolygon :: Int - Side - Shape such that
regularPolygon n s is a regular polygon with n sides, each of length
s. (Hint: consider using some of Haskell's trigonometric
functions, such
as sin :: Float - Float, cos :: Float - Float, and tan :: Float
Hi,
The Haskell desugaring for list comprehensions is given in:
http://haskell.org/onlinereport/exps.html#list-comprehensions
All the rules seem to be left to right rewrites, apart from the second
one, which seems to be right to left. Is there some deep reason for
this, or is this accidental.
Hi
Sorry for the noise, I've now realised they are a left to right
rewrite system, the second rule is required to set up the base case.
Thanks
Neil
On 8/19/07, Neil Mitchell [EMAIL PROTECTED] wrote:
Hi,
The Haskell desugaring for list comprehensions is given in:
Setup.hs:13:7:
Could not find module `Distribution.Compat.FilePath':
it is hidden (in package Cabal-1.1.6.2)
This is what I did to make takusen build with ghc-6.6.1:
[EMAIL PROTECTED]: .../haskell/takusen_0 darcs whatsnew
{
hunk ./Setup.hs 13
-import
Does GHC do stuff like converting (2*) into (shift 1) or converting x +
x into 2*x?
If I do x * sin 12, is GHC likely to compute sin 12 at compile-time?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Since it is not really Haskell related, I have answered by email. If
anyone is interested, don't hesitate to email me.
alpheccar.
This isn't really a Haskell question but I'm guessing some Haskell
hackers have a solution. MacOS X's Spotlight doesn't seem to be able
to search for text in .lhs
Neil Mitchell wrote:
The Haskell desugaring for list comprehensions is given in:
http://haskell.org/onlinereport/exps.html#list-comprehensions
All the rules seem to be left to right rewrites, apart from the second
one, which seems to be right to left. Is there some deep reason for
this, or is
DavidA wrote:
Twan van Laarhoven twanvl at gmail.com writes:
The solution is to use a dummy parameter:
class IntegerType a where
value :: a - Integer
Thanks to all respondents for this suggestion. That works great.
I prefer a slightly elaborate way,
newtype Mark n t = Mark t
Hi
I am using collections-0.3 and need to perform some operations on keys resp.
values of a map. In the concrete implementations there are functions
like 'elems' and 'keys' but there is no such thing in Data.Collections.
Instead there are the types 'ElemsView' and 'KeysView' and
functions
On 8/18/07, Matthew Sackman [EMAIL PROTECTED] wrote:
Also, one thing to watch out for is the fact the existing Get and Put
instances may not do anything like what you expect. For example, for
some reason I expected that the instances of Get and Put for Float and
Double would send across the
On 8/19/07, Andrew Coppin [EMAIL PROTECTED] wrote:
Does GHC do stuff like converting (2*) into (shift 1) or converting x +
x into 2*x?
Hmm, that's an interesting architecture where multiplication is
cheaper than addition :-)
If I do x * sin 12, is GHC likely to compute sin 12 at
On Sun, Aug 19, 2007 at 12:53:07PM +0100, Andrew Coppin wrote:
Does GHC do stuff like converting (2*) into (shift 1) or converting x + x
into 2*x?
For a good time, compile some code which uses even or odd :: Int - Bool
using -O2 -fasm -ddump-asm... The compiler *really* shouldn't be using
Thanks. I got confused because the StackOverflow link on
http://www.haskell.org/haskellwiki/HaWiki_migration
is dead.
-Original Message-
From: Derek Elkins [mailto:[EMAIL PROTECTED]
Sent: Saturday, August 18, 2007 8:54 PM
To: Peter Verswyvelen
Cc: haskell-cafe@haskell.org
Subject: Re:
The page
http://www.haskell.org/haskellwiki/Applications_and_libraries/Mathematics#Number_representations
lists several implementations of several flavours of computable reals,
which may be useful for you.
___
Haskell-Cafe mailing list
On 8/19/07, Frank Buss [EMAIL PROTECTED] wrote:
(*) Exercise 2.2
Define a function regularPolygon :: Int - Side - Shape such that
regularPolygon n s is a regular polygon with n sides, each of length
s. (Hint: consider using some of Haskell's trigonometric
functions, such
as sin ::
Subject: IO in HApps handler ?
I am trying to add a handler that would run an external command in
HApps 0.8.8, and I got a type issue I do not know how to get around..
can we have IO in a handler ?
testcmdpost.hs:52:8:
Couldn't match expected type `Ev st Request'
against inferred
Date: Sun, 19 Aug 2007 12:39:50 +0200
Subject: Fwd: ghc 6.7 /6.8
hello.
will 6.7 be released, or will only 6.8 be ?
( i.e do you use an even/uneven
relesing number convention)
-in that case, does the 6.8 branch means the freeze is on, and what would be
the target for 6.8 ? Q3/2007 ? Q4 ?
(
Hi
will 6.7 be released, or will only 6.8 be ?
6.7 is the HEAD branch, 6.8 will be released.
-in that case, does the 6.8 branch means the freeze is on, and what would be
the target for 6.8 ? Q3/2007 ? Q4 ?
Soon, in the next month - according to latest targets/estimates.
( context: I am
Stefan O'Rear wrote:
On Fri, Aug 17, 2007 at 04:27:29PM -0400, Thomas Hartman wrote:
trying to compile regex-tdfa, I ran into another issue. (earlier I had a
cabal problem but that's resolved.)
there's a line that won't compile, neither for ghc 6.6.1 nor 6.7
import
On Sun, Aug 19, 2007 at 11:25:49PM +0100, ChrisK wrote:
#ifdef __GLASGOW_HASKELL__
foreign import ccall unsafe memcpy
memcpy :: MutableByteArray# RealWorld - MutableByteArray# RealWorld -
Int# - IO ()
{-# INLINE copySTU #-}
copySTU :: (Show i,Ix i,MArray (STUArray s) e (ST s))
Hi folks!
So, in writing my chess engine, I've been trying to maintain 2 Map
objects. One maps squares on the board to Ints, the other maps Ints to
actual Pieces. It occurred to me that it would be useful to explicitly
have a Bi-directional Map, which does the maintenance of keeping the
Maps
From: Rafael Almeida [mailto:[EMAIL PROTECTED]
I used the cosine law in order to calculate r. After all, s is
actually the size of the side of the polygon and not the distance of
its vertices from the origin.
You are right, my solution was wrong. If you don't mind rounding errors,
this is
Hi TAESCH,
THat's what haskell is good for.
It prevents you from doing unsafe things by accident.
You must get the source and have a look at the definition of the Ev
type: (module HAppS.MACID.Types where:)
(Not sure wether this code is most recent or not (Version: 0.8.8))
=
Subject: IO in HApps handler ?
I am trying to add a handler that would run an external command in
HApps 0.8.8, and I got a type issue I do not know how to get around..
can we have IO in a handler ?
http://www.haskell.org/haskellwiki/HAppS_tutorial#Application
The MACID monad lets you update
25 matches
Mail list logo