Hey all,
I'm trying to call a Haskell function from C, on OS X. There's an
excellent post [1] by Tomáš Janoušek that explains how to do this on
Linux. However, on OS X, it's different. First of all, it looks like
the -no-hs-main flag is ignored, because I get the following error:
ghc
Dan Weston wrote:
Can you elaborate on why Const is not a monad?
return x = Const x
fmap f (Const x) = Const (f x)
join (Const (Const x)) = Const x
This is not Const , this is the Identity monad.
The real Const looks like this:
newtype Const b a = Const b
instance Monoid b =
Hi all,
I'm trying to create a HaskellDB application for keeping the inventory
of a set of devices. My database includes some tables which have some
columns with same names. Here is an example:
Server: id, name, vendor (fk), model(fk), system_id (always null)
Vendor: id, name
Model: id, name
Hi
On 30 Oct 2009, at 16:14, Yusaku Hashimoto wrote:
Hello cafe,
Do you know any data-type which is Applicative but not Monad?
[can resist anything but temptation]
I have an example, perhaps not a datatype:
tomorrow-you-will-know
Cheers
Conor
On 10/31/09, Heinrich Apfelmus apfel...@quantentunnel.de wrote:
The only possible monad instance would be
return x = Const mempty
fmap f (Const b) = Const b
join (Const b) = Const b
Your join doesn't seem to have the right type... Unless I'm missing something.
Bob
Am Samstag 31 Oktober 2009 12:25:17 schrieb Tom Davie:
On 10/31/09, Heinrich Apfelmus apfel...@quantentunnel.de wrote:
The only possible monad instance would be
return x = Const mempty
fmap f (Const b) = Const b
join (Const b) = Const b
Your join doesn't seem to have the
Somehow, I agree with you.
I think inherit is not evil, the people use it wrong is. The problem
here is, inherit is naked right now. So people could use it wrong.
On Fri, Oct 30, 2009 at 7:42 PM, Yaakov Nemoy loupgaroubl...@gmail.com wrote:
2009/10/30 Peter Verswyvelen bugf...@gmail.com:
The
After all, I never think OO as an oppsite way to all other things. The
idea is so general that if you say I cannot use it in Haskell at all,
that would make me feel weird. The only difference between languages
is, some are easy to be in OO style, some are not.
2009/10/31 Andrew Coppin
On 10/31/09, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote:
After all, I never think OO as an oppsite way to all other things. The
idea is so general that if you say I cannot use it in Haskell at all,
that would make me feel weird. The only difference between languages
is, some are
Yoda Master tells understands he you not, inheritance naked can be
how, you clarify please asks he to.
2009/10/31 Magicloud Magiclouds magicloud.magiclo...@gmail.com:
Somehow, I agree with you.
I think inherit is not evil, the people use it wrong is. The problem
here is, inherit is naked right
My ghci installation has a very annoying behavior: When it takes
input, the result is displayed on the same line as the input,
overwriting the prompt and input. Viz.:
[1015] : ghci
GHCi, version 6.10.4: http://www.haskell.org/ghc/ :? for help
Loading package
On Sat, Oct 31, 2009 at 6:22 AM, Heinrich Apfelmus
apfel...@quantentunnel.de wrote:
Dan Weston wrote:
Can you elaborate on why Const is not a monad?
return x = Const x
fmap f (Const x) = Const (f x)
join (Const (Const x)) = Const x
This is not Const , this is the Identity monad.
The
cabal haddock -–hyperlink-source
installs documentation with links to source code, which also be on by defualt.
cabal install –haddock-options=–hyperlink source
does not install hyperlinked source.
cabal install –haddock-options=-–hyperlink sourceblehblehbleh
doesn’t throw an error, which
On 10/13/09, Dimitry Golubovsky golubov...@gmail.com wrote:
Max,
Thanks for the explanation. So, the extcore library is expected to
match the spec in
http://www.haskell.org/ghc/docs/6.10.4/html/ext-core/core.pdf and the
core itself can be produced with -fext-core, correct? I think it
On Thu, Oct 29, 2009 at 1:32 PM, Hector Guilarte hector...@gmail.comwrote:
Thanks Tim! I got it! I have never declared a function before in a let ...
in statement, I always do it in a where after I call it...
where is just syntactic sugar for let...in
-- ryan
On Sat, Oct 31, 2009 at 8:38 AM, David Menendez d...@zednenem.com wrote:
On Sat, Oct 31, 2009 at 6:22 AM, Heinrich Apfelmus
apfel...@quantentunnel.de wrote:
The only possible monad instance would be
return x = Const mempty
fmap f (Const b) = Const b
join (Const b) = Const b
On Sat, Oct 31, 2009 at 8:09 PM, Ryan Ingram ryani.s...@gmail.com wrote:
where is just syntactic sugar for let...in
That's not perfectly true : where and let...in don't attach to the
same syntactic construction, where attaches to a definition and can
works for several guard clauses whereas let
I found the post at the following link to be the most useful in explaining
declarative versus imperative:
http://www.haskell.org/pipermail/haskell-cafe/2009-September/067000.html
Here follows what I want to add to the discussion:
Shelby Moore wrote:
The most accurate question should be, How do you add some numbers with
minimized instructions?, because it forces them to realize they must
order the set.
An answer might be, Zero if empty, else order the set, sum the first
number with the sum of remainder of the set.
http://www.haskell.org/pipermail/cvs-ghc/2009-October/050928.html
Shelby Moore wrote:
One possible runtime optimization to provide an upper bound for cache
control, might be to not cache thunks when the runtime computation time
times number of cache hits, is less than the round-trip paging time
Mecha is a little solid modeling language intended for machine design.
Mecha has two layers: a pure functional layer for defining solids
(aka. parts), and a monadic layer for arranging parts into assemblies.
Solids (parts) are built using set operations on solid primitives. A
solid primitives
I'm trying:
instance Num b = Num (a - b) where
fromInteger = pure . Prelude.fromInteger
negate = fmap Prelude.negate
(+) = liftA2 (Prelude.+)
(*) = liftA2 (Prelude.*)
abs = fmap Prelude.abs
signum = fmap Prelude.signum
but the compiler rejects it with:
src\Main.hs:24:9:
Could not deduce
Hey cafe,
If any of you were (or are) Common Lispers, you may be aware of Dr. Conrad
Barski's humorous and lighthearted
approach to Common Lisp. As a little tribute to his CL evangelization
efforts, I ported his tutorial,
'Casting SPELs in Lisp' (http://www.lisperati.com/casting.html) to
On Sat, 31 Oct 2009, b1g3ar5 wrote:
I'm trying:
instance Num b = Num (a - b) where
fromInteger = pure . Prelude.fromInteger
negate = fmap Prelude.negate
(+) = liftA2 (Prelude.+)
(*) = liftA2 (Prelude.*)
abs = fmap Prelude.abs
signum = fmap Prelude.signum
but the compiler rejects it with:
For some reason, Show and Eq are superclasses of Num (despite Num not
actually using any of their methods), meaning that the compiler forces
you to write instances of Eq and Show before it even lets you write a
Num instance. I don't think anybody likes this, but I think we're
stuck with it for the
Neat! What a cool idea.
On Sat, Oct 31, 2009 at 5:27 PM, Tom Hawkins tomahawk...@gmail.com wrote:
Mecha is a little solid modeling language intended for machine design.
Mecha has two layers: a pure functional layer for defining solids
(aka. parts), and a monadic layer for arranging parts
Tom Davie tom.da...@gmail.com writes:
On 10/31/09, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote:
After all, I never think OO as an oppsite way to all other things. The
idea is so general that if you say I cannot use it in Haskell at all,
that would make me feel weird. The only
Gregory Collins wrote:
Tom Davie tom.da...@gmail.com writes:
On 10/31/09, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote:
After all, I never think OO as an oppsite way to all other things. The
idea is so general that if you say I cannot use it in Haskell at all,
that would
On Sun, Nov 1, 2009 at 2:00 AM, Michael Vanier mvanie...@gmail.com wrote:
Gregory Collins wrote:
Tom Davie tom.da...@gmail.com writes:
On 10/31/09, Magicloud Magiclouds magicloud.magiclo...@gmail.com
wrote:
After all, I never think OO as an oppsite way to all other things. The
idea is
The documentation of (|) says that it evaluates the first argument
before the second. The function is defined as
(http://www.haskell.org/ghc/docs/6.10-latest/html/libraries/parallel/src/Control-Parallel-Strategies.html#%3E|):
(|) :: Done - Done - Done
{-# INLINE (|) #-}
(|) = Prelude.seq
I'm
30 matches
Mail list logo