My module is not in any package. Your solution is VERY elegant.
thanks!
mf-hcafe-15c311f0c wrote:
>
>
> echo ':load ~/money/Money.hs' >> ~/.ghci
>
> works for me. this adds a line to the startup script that loads a
> file that is not in any package. if this module loads other modules,
> yo
echo ':load ~/money/Money.hs' >> ~/.ghci
works for me. this adds a line to the startup script that loads a
file that is not in any package. if this module loads other modules,
you may need to play with ':cd' in addition to ':load'.
hope this helps,
matthias
On Fri, Sep 04, 2009 at 06:14:50PM
On Fri, Sep 4, 2009 at 6:08 PM, zaxis wrote:
>
> I want to preload the module automatically when starting ghci. The module
> located in ~/work directory contains some functions i use everyday.
>
> Now i use an alias: alias ghci='ghci -i ~/money/Money.hs' which works fine.
> However i feel there may
I want to preload the module automatically when starting ghci. The module
located in ~/work directory contains some functions i use everyday.
Now i use an alias: alias ghci='ghci -i ~/money/Money.hs' which works fine.
However i feel there maybe are more elegant way.
thanks!
--
View this messa
On Sep 4, 2009, at 03:13 , Lyndon Maydwell wrote:
I recently updated glut through cabal to version GLUT-2.2.1.0, and
where once I had native windowing, now I can only seem to use X11.
Does anyone know how to use native windowing?
Do you use Fink or MacPorts? Check for OpenGL libraries instal
Am Samstag 05 September 2009 00:06:50 schrieb Alberto G. Corona:
> Hi
>
> I need to execute a procedure not in the IO monad, but in an any monad:
>
> I defined:
>
> forkM :: Monad m=> m a -> IO ThreadId
> forkM proc=forkIO $ proc `seq` return()
>
> I assumed that seq will force the evaluation of
Try >> instead of `seq`.
Alberto G. Corona wrote:
Hi
I need to execute a procedure not in the IO monad, but in an any monad:
I defined:
forkM :: Monad m=> m a -> IO ThreadId
forkM proc=forkIO $ proc `seq` return()
I assumed that seq will force the evaluation of proc and after, it
will dis
Hi
I need to execute a procedure not in the IO monad, but in an any monad:
I defined:
forkM :: Monad m=> m a -> IO ThreadId
forkM proc=forkIO $ proc `seq` return()
I assumed that seq will force the evaluation of proc and after, it
will discard his type (m a) and return () in the IO monad.as
I haven't sent out a release announcement for HStringTemplate in some
time. In that time, there's been a host of new users, and consequently
a host of feature requests and bug reports. Among the relatively
recent changes:
* Simple quasiquotation.
* Proper unicode support (files are read in UTF-8,
Although also a bit of a global hack, you could also hide one of the
packages using
ghc-pkg hide mtl-1.1.02
instead of uninstalling them I think.
Also, if you make a cabal file, you could specify the exact module you
want to use.
On Fri, Sep 4, 2009 at 11:03 PM, Michael Vanier wrote:
> Hi ever
Hi everyone,
I ran into this error when recompiling some code I hadn't worked on in a
while:
Foo.hs:19:7:
Could not find module `Control.Monad.Error':
it was found in multiple packages: monads-fd-0.0.0.1 mtl-1.1.0.2
I gather that monads-fd is supposed to be a replacement for mtl, but
Am Freitag 04 September 2009 21:57:27 schrieb Peter Verswyvelen:
> When ones makes an ADT with data constructors that has strict (and
> maybe unpacked) fields,
>
> e.g.
>
> data Vec2 a = Vec2 {-# UNPACK #-} !a {-# UNPACK #-} !a
>
> how does one define an NFData instance?
>
> Like this?
>
> instanc
Am Freitag 04 September 2009 21:23:35 schrieb Serge LE HUITOUZE:
> Hi Haskellers,
>
> I'm asking some advice on a small piece of code representing a
> simplified version of a treatment I need to perform.
> I have a line-oriented string/file, from which I want to extract
> only a substring of those
On Fri, Sep 4, 2009 at 12:57 PM, Peter Verswyvelen wrote:
> When ones makes an ADT with data constructors that has strict (and
> maybe unpacked) fields,
>
> e.g.
>
> data Vec2 a = Vec2 {-# UNPACK #-} !a {-# UNPACK #-} !a
>
> how does one define an NFData instance?
>
> Like this?
>
> instance NFDat
Or for a bit of variety:
selectPlus s = [cs | ('+':cs) <- lines s]
--Ben
On 4 Sep 2009, at 20:40, Martijn van Steenbergen wrote:
Hi Serge,
Serge LE HUITOUZE wrote:
I'm asking some advice on a small piece of code representing a
simplified version of a treatment I need to perform.
I have a li
When ones makes an ADT with data constructors that has strict (and
maybe unpacked) fields,
e.g.
data Vec2 a = Vec2 {-# UNPACK #-} !a {-# UNPACK #-} !a
how does one define an NFData instance?
Like this?
instance NFData a => NFData (Vec2 a) where
rnf (Vec2 x y) = rnf x `seq` rnf y
Or is it e
Hi Serge,
Serge LE HUITOUZE wrote:
I'm asking some advice on a small piece of code representing a
simplified version of a treatment I need to perform.
I have a line-oriented string/file, from which I want to extract
only a substring of those lines starting with char '+' (the detail
of the extrac
Hi Haskellers,
I'm asking some advice on a small piece of code representing a
simplified version of a treatment I need to perform.
I have a line-oriented string/file, from which I want to extract
only a substring of those lines starting with char '+' (the detail
of the extraction is irrelevant he
Just copypasted it from my own email. Works fine.
On 4 Sep 2009, at 20:05, Grigory Sarnitskiy wrote:
This time I've checked that it really compiles. Pretty much sure it
works.
But how?! I'can't compile it:
test.hs:11:2:
Conflicting definitions for `put''
Bound at: test.hs:11:2-5
greetings,
greencard is confusing me: I copied an example from the command line
and was hoping to look at some generated Haskell code to understand
what's going on, but got this instead:
| $ cat M1.gc
| module M1 where
| %enum PosixError Int [EACCES, ENOENT]
| $ greencard M1.gc
| greencard: user
Well, I've managed to produce a solution, quite ugly and unefficient. Still it
works (and I really need it). StdGen serialization occurs only once during
computation that lasts several hours, so the speed is not vital for me. Here is
my solution:
module Main where
import System.Random
import D
> This time I've checked that it really compiles. Pretty much sure it works.
But how?! I'can't compile it:
test.hs:11:2:
Conflicting definitions for `put''
Bound at: test.hs:11:2-5
test.hs:13:2-5
test.hs:20:2-5
In the default-methods for class Binary'
tes
On Fri, Sep 4, 2009 at 10:38 AM, Christian
Maeder wrote:
> Or "runghc" form /usr/bin?
/usr/bin/runghc is a symlink to the same file as runhaskell.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
> "Magicloud" == Magicloud Magiclouds
> writes:
Magicloud> Hi, I am using haskelldb and
Magicloud> haskelldb-hdbc-sqlite3. Well, I finally got the source
Magicloud> compiled and ran, I got this error: App: user error
Magicloud> (SQL error: SqlError {seState = "", seNative
Miguel Mitrofanov wrote:
Well, normally - you can't (unless there is some equivalent to the
constructor exported).
But there is a trick. You can use generic classes:
{-# OPTIONS_GHC -fglasgow-exts -XGenerics -package lang #-}
import Generics
class Binary' a where
put' :: a -> Put
get' :: G
Or "runghc" form /usr/bin?
Christian Maeder wrote:
> Maybe runhaskell is used for template haskell?
>
> HTH Christian
>
> Brian Sniffen wrote:
>> No, my ghci is now "exec
>> /Library/Frameworks/GHC.framework/Versions/610/usr/bin/ghc-6.10.4
>> -optc-m32 -opta-m32 -optl-m32 --interactive ${1+"$@"}
Maybe runhaskell is used for template haskell?
HTH Christian
Brian Sniffen wrote:
> No, my ghci is now "exec
> /Library/Frameworks/GHC.framework/Versions/610/usr/bin/ghc-6.10.4
> -optc-m32 -opta-m32 -optl-m32 --interactive ${1+"$@"}" and I still see
> the same result. Also, I have switched to "-
No, my ghci is now "exec
/Library/Frameworks/GHC.framework/Versions/610/usr/bin/ghc-6.10.4
-optc-m32 -opta-m32 -optl-m32 --interactive ${1+"$@"}" and I still see
the same result. Also, I have switched to "--ld-options" instead of
"--ld-option," which appears to have been a typo---cabal and setup
n
You're right.
The issue you've mentioned can be fixed easily - import Data.Generics
instead of Generics and get rid of -package lang (I've copied them from
the documentation without checking, seems like it's a bit outdated).
The real problem is that you can't use "Get a" in generics! And you
> {-# OPTIONS_GHC -fglasgow-exts -XGenerics -package lang #-}
Got some problems:
Could not find module `Generics':
it is a member of package ghc-6.8.2, which is hidden
Failed, modules loaded: none.
and for ghci test.hs -fglasgow-exts -XGenerics -package lang
ghc-6.8.2: unknown packag
Does adding -optc-m32 -opta-m32 -optl-m32 to /usr/bin/ghci
as well not help? (as I've posted before)
Cheers Christian
Brian Sniffen wrote:
> Having edited the Haskell Platform's /usr/bin/ghc in place, most
> packages install fine. I'm still having trouble with Pandoc, even
> given the advice:
>
Having edited the Haskell Platform's /usr/bin/ghc in place, most
packages install fine. I'm still having trouble with Pandoc, even
given the advice:
> Once cabal works, options --ld-option=-m32 (and also --gcc-option=-m32)
> may be used. These options may also be passed to "./Setup configure"
Th
Well, normally - you can't (unless there is some equivalent to the
constructor exported).
But there is a trick. You can use generic classes:
{-# OPTIONS_GHC -fglasgow-exts -XGenerics -package lang #-}
import Generics
class Binary' a where
put' :: a -> Put
get' :: Get a
put' {| Unit |} Uni
In System.Random StdGen is defined as
data StdGen = StdGen Int32 Int32
but its constructor StdGen is not exported. How to make StdGen to be an
instance of Binary? The following won't work:
instance Data.Binary.Binary StdGen where
put (StdGen aa ab) = do
Data.Binary.put aa
Hello all,
IFCP is a really inspiring place to hang/hack around with your fellow
Haskell hackers. So, straight from Edinburgh, I proudly present a new
release of fclabels[1,2], your favourite record selector package. This
version is joint work with Chris Eidhof and Sjoerd Visscher.
This p
Miguel Mitrofanov wrote:
> Your data type GridWidget doesn't have a parameter, yet you use it like
> it has one.
>
>> data GridWidget = forall widget. (WidgetClass widget) => GridWidget
>> widget
> ^
> |
> NB:-+
This is allowed as long as you have enabl
Hi haskell-cafe.
I recently updated glut through cabal to version GLUT-2.2.1.0, and
where once I had native windowing, now I can only seem to use X11.
Does anyone know how to use native windowing?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
h
The only knowledge the type system has about a GridWidget is that it
contains /some thing/ which is a member of the WidgetClass typeclass.
So the only thing you can do with the thing inside the GridWidget is
to apply functions of the WidgetClass. It might be easier to see with
the Show class instea
38 matches
Mail list logo