On 2009 Jan 7, at 20:58, Phil wrote:
-- 124353542542 is just an arbitrary seed
main :: IO()
main = do
let x = evalState getRanq1 (ranq1Init 124353542542)
print (x)
You're throwing away the state you want to keep by using evalState
there. But you're also missing the point of usi
Tim Newsham wrote:
I know the short-term answer is "use TH" to derive folds if
I want them, but I think such an important concept should probably
be part of the language.
If you don't mind the hairy code, there's always this generic answer
from #haskell almost a year ago:
http://hpaste.o
Dear Cafe,
Every now and then I find myself in the position where I'd like to
define some hairy value as a CAF instead of a literal, but I'd like for
it to be fully evaluated at compile-time rather than postponed until
runtime. It'd be possible to bludgeon the CPP into doing this, but it
seem
I've had to use some fold functions recently and I've come to
the conclusion that Haskell should automatically generate
fold functions for data definitions. To clarify what I mean,
for the data definition:
data MyData = This Int Char | That String Int Int
there should be a matching function
On Wed, Jan 7, 2009 at 8:54 PM, Ryan Ingram wrote:
> You can also use $() and [| |] inside [| |] to generate additional
> data in TH directly:
>
> ghci> runQ $ do { VarE n <- [| runIdentity |] ; [| \x -> $(recUpdE [|
> x |] [ fmap (\e -> (n,e)) [| 1 |] ]) |] }
> LamE [VarP x_2] (RecUpdE (VarE x_2
On Sat, Jan 03, 2009 at 10:48:44AM +0100, Gour wrote:
> So, considering that HDBC nicely abstracts API enabling one to easily
> switch from e.g. Sqlite3 to Postgres, and it is used as in example for
> database programming, it seems as logical (and the only) choice for
> Haskell database programmin
Thanks Chris,
The undefined works for me.
-John
On Wed, Jan 7, 2009 at 11:11 AM, ChrisK wrote:
> You can use "undefined" or "error ..." :
>
> {-# LANGUAGE RecursiveDo #-}
>> import Control.Concurrent.STM
>> import Control.Monad.Fix
>>
>> -- Transactional loop. A loop is a circular link list.
Hi Phil. First a quick style comment, then I'll get to the meat of
your question.
getRanq1 is correct; although quite verbose. A simpler definition is this:
getRanq1 = State ranq1
This uses the State constructor from Control.Monad.State:
State :: (s -> (a,s)) -> State s a
What it sounds like y
Hi,
I¹m a newbie looking to get my head around using the State Monad for random
number generation. I¹ve written non-monad code that achieves this no
problem. When attempting to use the state monad I can get what I know to be
the correct initial value and state, but can¹t figure out for the life
On Wed, Jan 7, 2009 at 12:58 PM, Jeff Heard wrote:
> And how do I encode
>
> a{ mousePositionf = b }
>
> in template haskell without using the [| |] syntax, so that I can use mkName?
Whenever I have a question like that, I just ask ghci:
$ ghci -fth
ghci> :m Control.Monad.Identity Language.Haske
Hi,
I¹m a newbie looking to get my head around using the State Monad for random
number generation. I¹ve written non-monad code that achieves this no
problem. When attempting to use the state monad I can get what I know to be
the correct initial value and state, but can¹t figure out for the life
Let me give you more information about this hypothetical job posting. Our
company is a startup CDN (
http://en.wikipedia.org/wiki/Content_Delivery_Network) about 3 years old and
doing well. You would hythothetically be one of 7 programmer who write all
the software involved in a CDN including http
Hello Haskellers,
I'm trying to convince my boss to use Haskell. His main concern is finding
people who know Haskell when hiring. He is comfortable with Java because he
knows he can always find a Java developer. So if I advertised we were
looking for Haskell programmers in New York City, how many
Hi,
a number of folks have been asking/looking for ways to avoid statically
linking
in GMP into GHC binaries under Windows. I've written up some notes on how
to go about doing this, which are now available from
http://haskell.forkio.com/gmpwindows
Let me know if it is useful (or works ;-)
Excerpts from Immanuel Litzroth's message of Wed Jan 07 16:53:30 -0600 2009:
> I'm trying to use the new (for me at least) extensible exceptions and
> I am little amazed that I cannot get catch, try or mapException to work
> without telling them which exceptions I want to catch.
> What is the ratio
I'm trying to use the new (for me at least) extensible exceptions and
I am little amazed that I cannot get catch, try or mapException to work
without telling them which exceptions I want to catch.
What is the rationale behind this?
How does bracket manage to catch all exceptions?
What should onExce
Bueno, Denis wrote:
Oh, do you mean by actually calling memcpy via ffi?
http://www.haskell.org/ghc/docs/latest/html/libraries/base/Foreign-Marshal-Utils.html
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listin
Smart constructors sometimes need to generate errors like
"Foo.Bar.Baz.create: invalid value, etc". Can TH generate the module
and function names?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
It doesn't typecheck, no, but it also doesn't check out in scope. It
complains in
[FunD 'mousePosition [| mousePositionf |] ...
that mousePositionf isn't in scope.
What I believe I need to do is use mkName "mousePositionf", but how do
I bind the record getter "mousePositionf" that is defined by
Frederik Deweerdt wrote:
On Wed, Jan 07, 2009 at 10:35:25AM +0100, Michael Lesniak wrote:
Hello,
currently I'm searching for a topic for my phd-thesis or at least for
a workshop-paper (as a starting point, to get my feet wet...). My
academic group has specialized itself on (practical, i.e. n
Oh, do you mean by actually calling memcpy via ffi?
From: Don Stewart [d...@galois.com]
Sent: Wednesday, January 07, 2009 9:23 AM
To: Bulat Ziganshin
Cc: Bueno, Denis; haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] Blitting one IOUArray into another
Y
Am Mittwoch, 7. Januar 2009 16:56 schrieb Bueno, Denis:
> Hi all,
>
> I'm seeing a lot of unexpected memory allocation with some simple code that
> copies the contents of one vector (IOUArray Int Int64) into another of the
> same type and dimensions. In particular, profiling reveals that `copyInto
Ooh, great -- could you point me in the right direction for that?
From: Don Stewart [d...@galois.com]
Sent: Wednesday, January 07, 2009 9:23 AM
To: Bulat Ziganshin
Cc: Bueno, Denis; haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] Blitting one IOUArray i
Potential ICFP attendees:
The ACM-SIGPLAN Executive Committee, which oversees and sponsors ICFP,
is considering expanding its travel grants for event participants in
need of child care assistance. (Such expansion would also apply to
other major SIGPLAN-sponsored conferences, such as PLDI, POPL,
O
You can of course memcpy unboxed arrays fairly easily.
bulat.ziganshin:
> Hello Denis,
>
> Wednesday, January 7, 2009, 6:56:36 PM, you wrote:
>
> memory allocated for i :)))
>
> each new copy of i needs one word. the situation was much worse with
> Int64, of course :)
>
>
> > Hi all,
>
> > I
On Wed, 7 Jan 2009, Henning Thielemann wrote:
On Wed, 7 Jan 2009, Jan Christiansen wrote:
This is great. I am working on the very same topic for quite a while now.
My aim is to develop a tool that tells you whether a function is least
strict. My work is based on an idea by Olaf Chitil:
ht
On Wed, 7 Jan 2009, Jan Christiansen wrote:
This is great. I am working on the very same topic for quite a while now. My
aim is to develop a tool that tells you whether a function is least strict.
My work is based on an idea by Olaf Chitil:
http://www.cs.kent.ac.uk/people/staff/oc/
Althoug
Hello Denis,
Wednesday, January 7, 2009, 6:56:36 PM, you wrote:
memory allocated for i :)))
each new copy of i needs one word. the situation was much worse with
Int64, of course :)
> Hi all,
> I'm seeing a lot of unexpected memory allocation with some simple code that
> copies the contents of
Hi all,
I'm seeing a lot of unexpected memory allocation with some simple code that
copies the contents of one vector (IOUArray Int Int64) into another of the
same type and dimensions. In particular, profiling reveals that `copyInto'
is allocating oodles and oodles of memory.
My small test case
On Wed, 7 Jan 2009, Jan Christiansen wrote:
The non least strict definition of (*) is taken from the module
Data.Number.Natural which was published by Lennart Augustsson in the numbers
package at hackage. I mention this here because I think it clearly shows that
it is even hard for experience
This is great. I am working on the very same topic for quite a while
now. My aim is to develop a tool that tells you whether a function is
least strict. My work is based on an idea by Olaf Chitil:
http://www.cs.kent.ac.uk/people/staff/oc/
I think he was the first who introduced the idea of l
On Wed, Jan 07, 2009 at 10:35:25AM +0100, Michael Lesniak wrote:
> Hello,
>
> currently I'm searching for a topic for my phd-thesis or at least for
> a workshop-paper (as a starting point, to get my feet wet...). My
> academic group has specialized itself on (practical, i.e. not too
> theoretical
Dan Weston wrote:
>
> I hope the code is better than my description! :) The structure is more
> like
>
> Nothing(RK 0 _)
> Nothing(RK 1 _)
> A(RK 2 4)
> B(RK 3 6)
> C(RK 2 0)
>
>> The root of the tree is the center and you can descend on the right.
>> But with this structure, wal
Hello,
currently I'm searching for a topic for my phd-thesis or at least for
a workshop-paper (as a starting point, to get my feet wet...). My
academic group has specialized itself on (practical, i.e. not too
theoretical stuff like verification, etc...) parallel programming and
related topics, so
34 matches
Mail list logo