I have a bunch of global variables in C I would like to directly read
and write from Haskell. Is this possible with FFI, or must I write a
bunch of C wrapper functions for the interface, i.e. a 'get' and a
'set' for each variable?
I'm building a simulator for one of our embedded systems. The C
Jason Dagit wrote:
On Mon, Apr 19, 2010 at 3:01 AM, Daniil Elovkov
daniil.elov...@googlemail.com mailto:daniil.elov...@googlemail.com
wrote:
Hello haskellers!
I'm trying to process an xml file with as little footprint as
possible. SAX is alright for my case, and I think that's
Hi
If you are working with characteristic functions (Point - Bool or
Point - Colour...) the common way to do this is to manufacture a Num
instance for functions. This gives you syntax overloading of the (+,
-, *) operators. Similarly you might want to overload (or have to
overload) Floating,
Great job Stephen.
Thank for explaining . I got it to work.
On Tue, Apr 20, 2010 at 9:21 AM, Stephen Tetley stephen.tet...@gmail.comwrote:
Hi
If you are working with characteristic functions (Point - Bool or
Point - Colour...) the common way to do this is to manufacture a Num
instance for
Daniel Fischer wrote:
Heinrich Apfelmus:
For instance, your expression can be replaced by
filter (/=0) [hammingX x y | (x:xs) - tails example, y - xs]
which cuts the total running time in half. It's still quadratic in the
length of example . I'm sure there are faster algorithms out
On Tue, Apr 20, 2010 at 8:48 AM, Tom Hawkins tomahawk...@gmail.com wrote:
I have a bunch of global variables in C I would like to directly read
and write from Haskell. Is this possible with FFI, or must I write a
bunch of C wrapper functions for the interface, i.e. a 'get' and a
'set' for
Tom Hawkins wrote:
I have a bunch of global variables in C I would like to directly read
and write from Haskell. Is this possible with FFI,
Yes it is, as explained in section 4.1.1. in the FFI specification [1].
An import for a global variable int bar would look like this:
foreign
On 09/04/2010 12:14, Bertram Felgenhauer wrote:
Simon Marlow wrote:
On 09/04/2010 09:40, Bertram Felgenhauer wrote:
timeout t io = mask $ \restore - do
result- newEmptyMVar
tid- forkIO $ restore (io= putMVar result)
threadDelay t `onException` killThread
Hi,
Have you seen the derive package? It also generates QuickCheck
instances in virtually the same way - plus it can generate source code
and do lots of other types of instances.
http://community.haskell.org/~ndm/derive/
Thanks, Neil
2010/4/20 Bas van Dijk v.dijk@gmail.com:
2010/4/19
Jonas,
You can also derive (Co)Arbitrary instances automatically using the
regular-extras package based on the Regular generic programming library.
The advantage of using a library like Regular is that you do not have to write
any Template Haskell code. The library generates a nice algebraic
Dear all,
I am trying to compile a project with the "-prof -auto-all" profile options. But the compiler returns:
"Could not find module `Text.ParserCombinators.Parsec.Language':Perhaps you haven't installed the profiling libraries for package `parsec-3.1.0'?Use -v to see a list of the
rodrigo.bonifacio rodrigo.bonifa...@uol.com.br writes:
Could not find module `Text.ParserCombinators.Parsec.Language':
Perhaps you haven't installed the profiling libraries for package
`parsec-3.1.0'?
Use -v to see a list of the files searched for.
How did you install parsec? You
:-( - it seems that cabal install wx isn't how you install it on
Windows, not by a long shot.
I'm currently a Gtk2hs user. If wx got to the point where cabal
install wx either installed wx, including all it's non-Haskell
dependencies, or printed out a message you're a windows user who
hasn't
Hi Ivan,
I tried doing
cabal install parsec = 3 --reinstall --enable-library-profiling
This complained about bytestring ... so I did this -
cabal install bytestring --reinstall --enable-library-profiling
And this complained about base -
Data/ByteString.hs:278:7:
Could not find module
On 04/20/10 06:56, Simon Marlow wrote:
On 09/04/2010 12:14, Bertram Felgenhauer wrote:
Simon Marlow wrote:
On 09/04/2010 09:40, Bertram Felgenhauer wrote:
timeout t io = mask $ \restore - do
result- newEmptyMVar
tid- forkIO $ restore (io= putMVar result)
threadDelay t `onException` killThread
Am Dienstag 20 April 2010 18:59:23 schrieb C K Kashyap:
Hi Ivan,
I tried doing
cabal install parsec = 3 --reinstall --enable-library-profiling
This complained about bytestring ... so I did this -
cabal install bytestring --reinstall --enable-library-profiling
And this complained about
2010/04/19 Gregory Crosswhite gcr...@phys.washington.edu:
Thanks for the link; my ultimate interest, though, is in an architecture
that could scale to multiple machines rather than multiple cores with shared
memory on a single machine. Has there been any interest and/or progress in
making
Thanks Daniel, that worked.
On Tue, Apr 20, 2010 at 11:24 PM, Daniel Fischer
daniel.is.fisc...@web.dewrote:
Am Dienstag 20 April 2010 18:59:23 schrieb C K Kashyap:
Hi Ivan,
I tried doing
cabal install parsec = 3 --reinstall --enable-library-profiling
This complained about
Hi all,
I'd like to announce the first release of Hamlet[1], a templating system
which is fully compile-time checked. Templates are parsed via quasi-quoting,
giving you greater confidence in the validity of your templates. The syntax
is inspired by Haml[2]; however, it is most definitely its own
Hi Neil and Sebastiaan,
Thanks for the constructive criticism ;).
As far as i can tell, derive only works for regular and linear
recursive types and Regular uses frequencies to regulate size. (Also
Regular doesn't seem to work for QuickCheck-2).
I think I may have used a too simple example in
On Sat, Apr 17, 2010 at 2:52 PM, Henning Thielemann
schlepp...@henning-thielemann.de wrote:
Ryan Ingram schrieb:
It's used in the implementation of fail for those monads.
class Monad m where
...
fail :: String - m a
fail = error -- default implementation
which is then used to
On Thu, Apr 15, 2010 at 10:59 PM, zaxis z_a...@163.com wrote:
instance (BinaryDefer a, BinaryDefer b) = BinaryDefer (a,b) where
put (a,b) = put2 a b
get = get2 (,)
size x = let ~(a,b) = x in size a + size b
putFixed (a,b) = putFixed2 a b
getFixed = getFixed2 (,)
in `size`
On Tue, Apr 20, 2010 at 01:48:16AM -0500, Tom Hawkins wrote:
I have a bunch of global variables in C I would like to directly read
and write from Haskell. Is this possible with FFI, or must I write a
bunch of C wrapper functions for the interface, i.e. a 'get' and a
'set' for each variable?
Dear Haskellers,
I'm happy, and only slightly intimidated, to announce the initial
release of forkable-monad.
The short version is that forkable-monad exports a replacement forkIO
that lets you do this:
type MyMonad = ReaderT Config (StateT Ctx IO)
startThread :: MyMonad ThreadId
startThread =
I don't mind the 0.0 == -0.0 case, its the NaN /= NaN one that gets me. ;)
The former just says that the equivalence relation you are using isn't
structural. The latter breaks the notion that you have an equivalence
relation by breaking reflexivity.
Eq doesn't state anywhere that the instances
On Tue, 20 Apr 2010, wren ng thornton wrote:
-- | The isomorphic Haskell98 version
class Monad m = MonadJoinIO m where
-- | Embed the IO into the monad m
joinIO :: IO (m a) - m a
-- | Extract the IO computation to the top level,
-- rendering
On Apr 20, 2010, at 11:05 AM, Jason Dusek wrote:
Thanks for the link; my ultimate interest, though, is in an
architecture
that could scale to multiple machines rather than multiple cores
with shared
memory on a single machine. Has there been any interest and/or
progress in
making DPH
27 matches
Mail list logo