Hi Vishy,
You wrote:
I have just started on my journey in learning Haskell.
Welcome aboard! We all wish you an enjoyable and
(type)safe trip.
I have started off reading wikibook, then will read yet
another tutorial on haskell. Please guide
me if I am on right track
Those are both great
Lennart Augustsson wrote:
I think seq is funny because it is not lambda definable.
I wrote:
Does the set of computable functions on the natural
numbers defined by the lambda calculus augmented
with seq have higher Turing degree than the
set of classical computable functions?
I guess I was
Hi,
I would like to use FFI for the first time. Can someone
give me a really, really simple complete example?
I want to be able to take a simple C program and
access a function from it in Haskell. A simple example
of the other way around would be nice, too, but I
don't happen to need that just
I would like to use FFI for the first time. Can someone
give me a really, really simple complete example?
Everything I found on the wiki
seems way beyond that - maybe I missed it.
I am using GHC. I am not using Windows.
From the old wiki:
http://www.haskell.org/hawiki/FfiCookbook
Hello Yitzchak,
Friday, February 9, 2007, 3:23:53 PM, you wrote:
I would like to use FFI for the first time. Can someone
give me a really, really simple complete example?
nothing can be easier
main = print (c_mysin 1.0)
foreign import ccall mysin.h mysin
c_mysin :: Double - Double
Hi folks,
I recently read in my copy of Concrete Mathematics the relationship
between prime factors powers and lcm/gcd functions. So I decided to
reimplement gcd and lcm the long way, for no other reason than because
I could.
If you look at the definition of 'powers' you'll note it's infinite.
If you look at the definition of 'powers' you'll note it's infinite. So
there's no easy way to take the product of this list, if I don't know
how many items to take from it.
So you need finite lists.
-- how many of the prime p are in the unique factorisation
-- of the integer n?
On Feb 9, 2007, at 9:20 AM, Dougal Stanton wrote:
Hi folks,
I recently read in my copy of Concrete Mathematics the relationship
between prime factors powers and lcm/gcd functions. So I decided to
reimplement gcd and lcm the long way, for no other reason than because
I could.
If you look at
On Fri, 9 Feb 2007, Dougal Stanton wrote:
Hi folks,
I recently read in my copy of Concrete Mathematics the relationship
between prime factors powers and lcm/gcd functions. So I decided to
reimplement gcd and lcm the long way, for no other reason than because
I could.
If you look at the
Hi,
I noticed on Windows that when I use IO functions that write to stdout when
the process is lacking a console, those functions throw an IOError. I'm not
sure if this also occurs for stderr because I haven't tried it.
Some classes of processes are created without a console because they never
Sorry, I should clarify. I am writing about applications compiled with GHC.
-John
On 2/10/07, John Ky [EMAIL PROTECTED] wrote:
Hi,
I noticed on Windows that when I use IO functions that write to stdout
when the process is lacking a console, those functions throw an IOError.
I'm not sure if
On 09/02/07, John Ky [EMAIL PROTECTED] wrote:
I noticed on Windows that when I use IO functions that write to stdout when
the process is lacking a console, those functions throw an IOError. I'm not
sure if this also occurs for stderr because I haven't tried it.
This is Windows standard
Well, nobody likes tainting their beautiful pure code with IO, so I
rewrote the Random module to take advantage of the latest research [1]:
module Random where
getRandom = 4
Cheers,
D.
[1] http://xkcd.com/c221.html
--
Dougal Stanton
___
http://darcs.haskell.org/packages/cgi-undecidable/
There only 3 or 4 lines of source code, but it can't be installed.
The ghc version is 6.6 .
Undecidable.hs:23:0:
Duplicate instance declarations:
instance [overlap ok] (MonadTrans t, MonadCGI m, Monad (t m)) =
That's definitely the lazy approach!
On 2/9/07, Dougal Stanton [EMAIL PROTECTED] wrote:
Well, nobody likes tainting their beautiful pure code with IO, so I
rewrote the Random module to take advantage of the latest research [1]:
module Random where
getRandom = 4
Cheers,
D.
[1]
http://darcs.haskell.org/packages/cgi-undecidable/
There only 3 or 4 lines of source code, but it can't be installed.
The ghc version is 6.6 .
Undecidable.hs:23:0:
Duplicate instance declarations:
instance [overlap ok] (MonadTrans t, MonadCGI m, Monad (t m)) =
For those of you who like your Haskell code fast, then, if you're like
me, reading Core output all day can give you headaches.
Here's a couple of tricks I use to make optimising low level stuff easier.
1) Use Hscolour to pretty-ifiy the Core so its more parsable:
ghc -O Foo.hs -ddump-simpl
hi i am going through yaht tutorial and exercise 4.6 and 4.7..i understood
4.6,but not 4.7 in which fromTuple (One a ) = Left (Left a ) and fromTuple
(Two a b ) = Left (Right (a,b) ) function r written..why use Either
type..cant i just say fromTuple (Two a b )=(a,b)
18 matches
Mail list logo