André Batista Martins asked:
i want convert Either to a tree.
Example:
Either ( Either 1 2 ) ( Either 3 4)
Branch ( Branch (Leafl 1) (Leafr2) ) ( Branch (Leafl 3) (Leafr4)) )
Before writing the function to convert your data structure, why not
try writing
On Thu, Sep 23, 2010 at 1:57 PM, Andrew Coppin
andrewcop...@btinternet.com wrote:
If you think that sounds silly, ask some random person (not a computer
programmer, just some random human) how find the sum of a list of numbers. I
can practically guarantee that most humans will reply do X, then
Automatic differentiation can also bee seen this way. In a sense it
transforms a function to compute f(x) into a function to compute
f'(x), where f' is the derivative of f.
--
Dan
On Mon, Aug 23, 2010 at 6:03 AM, Eugene Kirpichov ekirpic...@gmail.com wrote:
Most of the well-known algorithms are
On Tue, Aug 3, 2010 at 2:51 PM, aditya siram aditya.si...@gmail.com wrote:
I am doing an Intro To Monads talk in September [1].
...what would you stay away from.
Some things to stay away from:
http://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/
Dupont asked:
do you know Nomic?
It's a fabulous and strange game where you have the right to change the rules
in the middle of the game!
I know nomic, but as has been pointed out, it's too wide-ranging to be
captured in Haskell. So how about a game played in the Haskell type
system where
On Thu, Apr 15, 2010 at 4:58 PM, Ashley Yakeley ash...@semantic.org wrote:
type Board a b c d e f g h i =
Either (Three a b c)
(Either (Three d e f)
(Either (Three g h i)
(Either (Three a d g)
(Either (Three b e h)
(Either (Three c f i)
(Either (Three a e i)
(Either (Three c e g)
I have a situation where I have a bunch of lists and I'll frequently
be making new lists from the old ones by applying map and filter. The
map will be applying a function that's effectively the identity on
most elements of the list, and filter will be using a function that
usually gives True. This
Günther,
A shining example are Dan Piponis blog posts.
When you get stuck, post a comment saying where so that I can learn
what people find difficult.
On the other hand, I understand how intangible not-understanding can
be, so it can be hard to point to where the problem is.
--
Dan
On Mon, Jan 4, 2010 at 3:01 PM, Derek Elkins derek.a.elk...@gmail.com wrote:
Ignoring bottoms the free theorem for fmap can be written:
If h . p = q . g then fmap h . fmap p = fmap q . fmap g
When I play with http://haskell.as9x.info/ft.html I get examples that
look more like:
If fmap' has
On Mon, Jan 4, 2010 at 3:26 PM, Derek Elkins derek.a.elk...@gmail.com wrote:
Yes, I have the same problem...Basically, I'm
pretty sure the construction of that free theorem doesn't rely on any
of the actual details...
For a long time I've thought such a higher order free theorem must
exist,
On Mon, Jan 4, 2010 at 4:15 PM, Paul Brauner paul.brau...@loria.fr wrote:
I wonder why this isn't some classic category theory result (maybe it is ?)
It doesn't hold in category theory in general.
Haskell (or at least a certain subset) is special - many things that
just *look* category
Can anyone tell me what command line options I need to build a simple
example using OpenCLRaw on MacOSX (ghc 6.10.4)? Using -framework
OpenCL reduces the missing symbols down to just _clGetProgramInfo but
I can't see how to eliminate that last one. Has anyone else played
with OpenCLRaw?
--
Dan
On Fri, Dec 11, 2009 at 11:46 AM, Andrew Coppin
andrewcop...@btinternet.com wrote:
On the other hand, turn up the optimisation settings on a C compiler high
enough and the program breaks.
Not if you write actual C as specified by the standard.
In fact, these days gcc internally converts your
2009/11/14 Daniel Schüssler anotheraddr...@gmx.de:
- Product (a,b) and co-product (Either) of monoids
the coproduct of monoids is actually a bit tricky.
Funny, I was just thinking about that.
I was pondering the article at LTU on Lawvere theories:
http://lambda-the-ultimate.org/node/3235
On Wed, Nov 11, 2009 at 4:24 PM, zaxis z_a...@163.com wrote:
data Branch tok st a = forall b. Branch (PermParser tok st (b - a))
(GenParser tok st b)
I have hoogled the `forall` but i cannot find any appropriate answer!
That's an example of an existential type. What that line is saying is
On Mon, Oct 12, 2009 at 10:42 AM, muad muad.dib.sp...@gmail.com wrote:
Is it possible to prove correctness of a functions by testing it? I think the
tests would have to be constructed by inspecting the shape of the function
definition.
not True==False
not False==True
Done. Tested :-)
Less
Joe,
On Mon, Oct 12, 2009 at 11:03 AM, Joe Fredette jfred...@gmail.com wrote:
I completely forgot about free theorems! Do you have some links to resources
-- I tried learning about them a while
ago, but couldn't get a grasp on them... Thanks.
There is Wadler's paper but I do find it tricky:
I'm making the same mistake repeatedly. In both my mails there are
places where I said (a,b) or (b,a) when I meant (a,a).
--
Dan
On Mon, Oct 12, 2009 at 11:09 AM, Dan Piponi dpip...@gmail.com wrote:
Joe,
On Mon, Oct 12, 2009 at 11:03 AM, Joe Fredette jfred...@gmail.com wrote:
I completely
On Mon, Oct 12, 2009 at 11:31 AM, Neil Brown nc...@kent.ac.uk wrote:
swap = undefined
Terminates and does not swap its arguments :-) What do free theorems say
about this, exactly -- do they just implicitly exclude this possibility?
I'm terrible at reasoning about functions with bottoms (ie.
2009/10/7 Joe Fredette jfred...@gmail.com:
Let me add to this, as I've used the term DSL without (*gasp*) fully
understanding it before.
In addition to What is a DSL, I'd like to ask:
How is a DSL different from an API?
I don't think there is a sharp divide here. A nice example was given
by
Yesterday I was at a talk by Pat Hanrahan on embedded DSLs and GPUs at
the nvidia GPU conference:
http://www.nvidia.com/object/gpu_technology_conference.html
Pat argued that the only way forward to achieve usable computing power
for physics on heterogeneous computers (eg. multicore+GPU) is
On Sat, Aug 22, 2009 at 3:35 AM, Peter Verswyvelenbugf...@gmail.com wrote:
Could you share your experiences with me about starting a blog?
BTW: I'm on Windows.
I've found it hard work to post a mixture of English, Mathematics and
Haskell. Neither of the most popular blogging web sites are very
On Wed, Jun 24, 2009 at 6:53 PM, Martin
Hofmannmartin.hofm...@uni-bamberg.de wrote:
I am looking for a good (preferably lazy) way to implement some kind of
best-first search.
So in fact, after one expansion, I need to fold over my complete search
space, maybe updating other nodes and
I really dislike this error message, and I think the terms are
ambiguous. I think the words 'expected' and 'inferred' apply equally
well to the term, and the context in which it has been found. Both of
the incompatible types were 'inferred', and 'unexpected' is a property
of the combination, not a
On Wed, Jun 17, 2009 at 6:08 PM, Jon Straitjstr...@moonloop.net wrote:
...but if there
were another monad defined like,
data MadMaybe a = Nothing | Perhaps | Just a
MadMaybe violates the second law. It's quite unlike a monad.
--
Dan
___
Haskell-Cafe
Duane,
Your fourth diagram is hard to distinguish from that for a function
that takes three inputs and returns one. And what would be the diagram
for a function that maps one binary function to another?
I spend a bit of my time at work playing with typed visual dataflow
type tools. I've never
2009/3/27 Kirk Martinez kirk.marti...@gmail.com:
I wonder: does the converse exist? Haskell data constructors which are
really functions? How and for what might one use those?
You might enjoy reading about the use of tries for memoisation. Conal
Elliott explains nicely how you can an
On Wed, Mar 25, 2009 at 12:44 PM, Thomas Hartman tphya...@gmail.com wrote:
Are you saying there's a problem with this implementation? It's the
Yes, there is actually a problem with this implementation.
However, there is something to be said for code that just looks like a
duck and quacks
Miguel Mitrofanov wrote:
takeList = evalState . mapM (State . splitAt)
However, ironically, I stopped using them for pretty
much the same reason that Manlio is saying.
Are you saying there's a problem with this implementation? It's the
only one I could just read immediately. The trick is to
On Tue, Mar 17, 2009 at 5:06 AM, Wolfgang Jeltsch
g9ks1...@acme.softbase.org wrote:
What is a “generalized monoid”? According to the grammatical construction
(adjective plus noun), it should be a special kind of monoid
There's no such implication in English. The standard example used by
2009/2/3 Rafael Gustavo da Cunha Pereira Pinto rafaelgcpp.li...@gmail.com:
After a discussion on whether is possible to compile hmatrix in
Windows, I decided to go crazy and do a LU decomposition entirely in
Haskell...
import Data.Array.IArray
...
e_an i j=a!(i,j)-(lik
On Wed, Feb 4, 2009 at 12:16 PM, Tymur Porkuian
shooshpanch...@gmail.com wrote:
For me, the key to understanding monads was that monad is a value
that know how to apply functions to itself. Or, more correctly, a
container that knows how to apply functions to whatever is inside it.
You've just
On Wed, Feb 4, 2009 at 12:57 PM, Rafael Gustavo da Cunha Pereira Pinto
rafaelgcpp.li...@gmail.com wrote:
Those different representations are derived from my (very) low Haskell
handicap! :-D
BTW That wasn't intended in any way as a criticism. I think it's
interesting to look at real matrix code
On Mon, Feb 2, 2009 at 8:09 AM, Gregg Reynolds d...@mobileink.com wrote:
Yes, that's my hypothesis: type constructors take us outside of set
theory (ZF set theory, at least). I just can't prove it.
It's too big for Set Theory if you insist on representing functions
in type theory as
2009/2/2 Luke Palmer lrpal...@gmail.com:
But Nat ~ Bool is computably uncountable, meaning there is no injective
(surjective?)
function Nat ~ (Nat ~ Bool), by the diagonal argument above.
Given that the Haskell functions Nat - Bool are computably
uncountable, you'd expect that for any
On Mon, Feb 2, 2009 at 3:18 PM, Reid Barton rwbar...@math.harvard.edu wrote:
toSame f = (const True, head [ ( k) | k - [1..], f (const True) == f ( k)
])
Nice! I like it because at first look it seems like there's no reason
for this to terminate, but as you correctly argue, it always does.
--
2009/1/23 Olex P hoknam...@gmail.com:
class Vector v where
(^+^) :: v - v - v
data Vector3 = V3 !Double !Double !Double
instance Vector Vector3 where
(V3 x1 y1 z1) ^+^ (V3 x2 y2 z2) = V3 (x1 + x2) (y1 + y2) (z1 + z2)
class Matrix m where
(^+^) :: m - m - m
data
On Wed, Jan 21, 2009 at 11:12 PM, Eugene Kirpichov ekirpic...@gmail.com wrote:
To my mind, in the map-reduce case you generally need a commutative
monoid. Or, you need an extra infrastructure that mappend's only
results from adjacent machines, or something like that.
This is a good paper on
Another important application of monoids is in parallelisation. In
map-reduce you want to split the reduce part over multiple processors
and combine the results back together again. Associativity ensures
that when you combine the pieces together you get the same result as
if you did the whole
On Mon, Jan 19, 2009 at 11:33 AM, Andrew Coppin
andrewcop...@btinternet.com wrote:
My only problem with it is that it's called Bool, while every other
programming language on Earth calls it Boolean. (Or at least, the languages
that *have* a name for it...)
Python: bool
ocaml: bool
C++: bool
On Mon, Jan 19, 2009 at 6:25 PM, David Menendez d...@zednenem.com wrote:
Are there any instances of Boolean that aren't isomorphic to Bool?
a-Bool for any a. I think.
Though I think it should be called GeorgeBoolean otherwise we might
confuse it for something his father might have invented.
--
On Sat, Jan 17, 2009 at 1:47 AM, david48 dav.vire+hask...@gmail.com wrote:
why would I
need to write a running count this way instead of, for example, a non
monadic fold, which would probably result in clearer and faster code?
Maybe my post here will answer some questions like that:
On Fri, Jan 16, 2009 at 12:09 PM, Paul Moore p.f.mo...@gmail.com wrote:
How about associativity means that how you pair up the operations
does not affect the result?
I think a better way is this: If you have an element of a monoid, a,
there are two ways to combine it with another element, on
On Thu, Jan 15, 2009 at 7:34 AM, John Goerzen jgoer...@complete.org quoted:
I'd be inclined to call it something like Appendable.
But I don't know what Appendable means. Maybe it means
class Appendable a where
append :: a x - x - a x
ie. a container x's lets you can add an x to the end
On Thu, Jan 15, 2009 at 12:11 PM, John Goerzen jgoer...@complete.org wrote:
On Thu, Jan 15, 2009 at 07:46:02PM +, Andrew Coppin wrote:
John Goerzen wrote:
can we at least write some documentation that doesn't
require a PhD to comprehend?
Several people have suggested this, and I think it
On Thu, Jan 15, 2009 at 1:29 PM, Andrew Coppin
andrewcop...@btinternet.com wrote:
But you
really *should not* need to do an undergraduate course in mathematical
theory just to work out how to concat two lists. That's absurd. Some kind of
balance needs to be found.
Balance is good, but it's
On Thu, Jan 15, 2009 at 2:24 PM, Miguel Mitrofanov
miguelim...@yandex.ru wrote:
If, however, you category is a category of endofunctors of some category D
(that is, functors D - D), and T is composition, then our monoids become
monads on D: I is an identity functor, first morphism is return,
2009/1/13 Peter Verswyvelen bugf...@gmail.com:
On page 102: partial function application is named currying
I thought currying or to curry means converting
f :: (a,b) -c
Confusion over these terms is commonplace. See, for example, the
discussion here: http://lambda-the-ultimate.org/node/2266
--
On Thu, Dec 18, 2008 at 4:15 PM, Henning Thielemann
schlepp...@henning-thielemann.de wrote:
In C/C++ referential transparent functions code can be declared by
appending a 'const' to the prototype, right?
For one thing, some fields in a const C++ object can be explicitly set
mutable. mutable is
On Sun, Dec 7, 2008 at 2:05 AM, Hans Aberg [EMAIL PROTECTED] wrote:
As for the operator itself, it appears in Alonzo Church, The Calculi of
Lambda-Conversion, where it is written as exponentiation, like x^f
That's reminiscent of the notation in Lambek and Scott where (roughly
speaking) the
2008/12/8 Joachim Breitner [EMAIL PROTECTED]:
So A^(B+C) = A^B × A^C ?
That's part of the basis for Hinze's paper on memoization:
http://www.informatik.uni-bonn.de/~ralf/publications/WGP00b.ps.gz
It's always nice to see that I havn't learned the elementary power
calculation rules for nothing
On Wed, Dec 3, 2008 at 10:17 AM, Matt Hellige [EMAIL PROTECTED] wrote:
From time to time, I've wanted to have a more pleasant way of writing
point-free compositions of curried functions.
I'd like to be able to write something like:
\ x y - f (g x) (h y)
This particular composition of f with
On Thu, Dec 4, 2008 at 10:21 AM, Matt Hellige [EMAIL PROTECTED] wrote:
\ f x y z - f x z y == id ~ flip
It's not clear to me whether your operad class can express this (or
whether operads in general can express this)
There exists an operad that can (at the cost of even more notation),
but
Real time audio applications are top of my list of crazy projects I
would work on if I had a month spare. I think it might work out
nicely. My approach wouldn't be to talk directly to audio hardware
from Haskell but instead use a framework like Lava to generate low
level code from an embedded DSL.
On Thu, Nov 13, 2008 at 11:08 AM, Andrew Coppin
[EMAIL PROTECTED] wrote:
In other words, Haskell is an excellent language for designing
special-purpose compilers and interpretters for custom languages. ;-)
If I knew a damned thing about IA32 assembly and dynamic linkage, I'd be
tempted to try
On Tue, Nov 4, 2008 at 9:26 AM, Achim Schneider [EMAIL PROTECTED] wrote:
Martijn van Steenbergen [EMAIL PROTECTED] wrote:
For anything remotely connected to parsing, always use parsec.
I'd not be surprised if the beast is touring complete in itself...
Actually, this can count against you.
I'd like to be able to write something like
map zipWith ([1,2,3] = printMyInferredType)
and have the compiler treat 'printMyInferredType' as undefined, but
also produce the side effect of printing out its inferred type.
What's the easiest way to simulate this with what we have now?
--
Dan
On Thu, Oct 23, 2008 at 1:26 PM, Andrew Coppin
[EMAIL PROTECTED] wrote:
Does anybody know of any tools for definitely pinning down stuff like this?
Surely C programmers have their code crash several hundred times a day due
to bugs like this...
Curiously, the tool I often use with C/C++ to
On Wed, Oct 1, 2008 at 2:59 AM, Manlio Perillo [EMAIL PROTECTED] wrote:
Miguel Mitrofanov ha scritto:
By the way, is it technically possible (and feasible), in Haskell, to define
a space operator?
In a way it's what is described in this paper:
http://www.cs.nott.ac.uk/~ctm/IdiomLite.pdf
In
On Wed, Oct 1, 2008 at 2:45 PM, Dan Piponi [EMAIL PROTECTED] wrote:
In the proposed notation, within [[]]'s there is an implied * for every
space.
Come to think of it, surely that's why they're called *applicative*
functors. In Haskell, a space between identifiers corresponds
implicitly
On Sun, Sep 21, 2008 at 7:49 PM, wren ng thornton [EMAIL PROTECTED] wrote:
We inherited our use of spaces for function application from Lisp and
friends, so foo bar baz looks perfectly natural to functionalists. But to
those used to seeing foo(bar, baz) the meaning attached to the spaces is
On Thu, Sep 18, 2008 at 11:59 AM, Andrew Coppin
[EMAIL PROTECTED] wrote:
foo :: Int - Maybe Int
foo x = do
4 - return x
return (2*x)
Now, if only I could find a use for all this
that borders on useful...! ;-)
It seems a lot less weird when you write something like:
[x | (x,0) - map
Mauricio asked:
Do you think 'read' (actually,
'readsPrec'?) could be made to also
read the international convention
(ie., read 1,5 would also work
besides read 1.5)?
What would you hope the value of
read (1,2,3)::(Float,Float)
would be?
--
Dan
fero asked:
Hi,
I would like to buy some booke on category theory and its applications. Can
you recommend me the best?
I got a lot out of Basic Category Theory for Computer Scientists by
Benjamin C. Pierce. Short and with examples biased towards CS. No
monads but it covers the essentials with
On Thu, May 29, 2008 at 8:58 PM, Jonathan Cast
[EMAIL PROTECTED] wrote:
It's not French
'tis so! Two dictionaries I've now checked say it entered English from
Hebrew via French 'cabale'. But that has to be the last I say on this
as it's now well off topic.
--
Dan
On Wed, May 28, 2008 at 6:38 PM, Richard A. O'Keefe [EMAIL PROTECTED] wrote:
I've always pronounced it k'BAHL, but was surprised to find that
the OED only countenances a short second syllable:
The reason I originally asked is that American, British and other
dialects of English handle French
In particular, which syllable gets the stress, and what are the
lengths of the two vowels? Couldn't find anything in the FAQ
(http://www.haskell.org/haskellwiki/Cabal/FAQ).
--
Dan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On Wed, May 21, 2008 at 4:08 PM, Lennart Augustsson
[EMAIL PROTECTED] wrote:
I certainly don't use 50% IO monads. I regard any use of the IO monad
except at the top level as a failure. :)
Real Haskell Programmers Only Use Top Level IO!
(But then again, real programmers wouldn't use Haskell:
On Mon, May 19, 2008 at 10:54 PM, Zsolt SZALAI [EMAIL PROTECTED] wrote:
Now, i'm getting familiar with monads, but there is a little discredit
about one-way monads.
If someone claims that monads are one-way they are probably
referring to the fact that it is impossible (without cheating!) to
On Fri, May 16, 2008 at 12:03 PM, Andrew Coppin
[EMAIL PROTECTED] wrote:
Since a tree is a kind of container, yes, it should be a monad. [I'm still
not really sure whether it's useful.]
Not so much containers in general, but 'flattenable' containers. You
can flatten a list of lists to a list
On Wed, May 14, 2008 at 12:03 PM, Andrew Coppin
[EMAIL PROTECTED] wrote:
It is well-known that trees with substitution form a monad.
Now that's funny. Compare with the first line of this paper:
http://citeseer.ist.psu.edu/510658.html
Anyway, I worked through an elementary example of this with
On Sat, May 10, 2008 at 7:20 AM, Neil Mitchell [EMAIL PROTECTED] wrote:
Jurriaan Hage and Stefan Holdermans. Heap recycling for lazy
languages. In John Hatcliff, Robert Glück, and Oege de Moor, editors,
_Proceedings of the 2008 ACM SIGPLAN Symposium on Partial Evaluation
and
Andrew asked,
...so it's a kind of choice operator? Run all actions until you get to one
that succeeds and return the result from that?
The eternal bit of trickiness for Haskell is that type classes group
often together things that people don't immediately see as similar -
monads probably
Miguel said:
Well, that's the whole point of mathematics, isn't it?
Abstraction is common to mathematics and computing. But in computing
the abstraction often follows lines that seem obvious. For example a
GUI library might have a Widget class and people can immediately
identify various regions
On Tue, Apr 1, 2008 at 2:07 PM, PR Stanley [EMAIL PROTECTED] wrote:
All you'd have to do is to give the inner most function the highest
precdence
What's the innermost function in f g x here?
test :: (a - b - c) - a - b - c
test f g x = f g x
--
Dan
On Fri, Mar 14, 2008 at 11:50 AM, Andrew Coppin
[EMAIL PROTECTED] wrote:
Haskell has an expressive and powerful type system - which I love. It
also has a seemingly endless list of weird and obscure type system
extensions...And yet, none of this happens in any other programming language
I've
2008/3/12 Jed Brown [EMAIL PROTECTED]:
It would be a shame to ...miss the very important point that a
matrix is nothing more than a linear transformation between finite
dimensional spaces.
I rate this obvious seeming fact as one of the most important things
I've learnt about numerical
On Wed, Mar 12, 2008 at 2:33 PM, Andrew Coppin
[EMAIL PROTECTED] wrote:
Hanging around here, you really feel like you're at the cutting edge
of... something... heh.
Another approach isn't to target a CUDA back end for Haskell but to
write an array library that builds computations that can
On Mon, Mar 10, 2008 at 3:11 PM, Paulo J. Matos [EMAIL PROTECTED] wrote:
I would like to know if in fact there's any difference in practice
between (), [()], i.e. if in practice the difference matters.
The type [()] is very similar to the type Integer and it's quite
different from () because
Edsko asked:
Is there an intuition that can be used to explain adjunctions to
functional programmers, even if the match isn't necessary 100% perfect
(like natural transformations and polymorphic functions?).
I think there's a catch because many interesting examples of
adjunctions involve
IOn Feb 11, 2008 9:46 AM, Miguel Mitrofanov [EMAIL PROTECTED] wrote:
It's well known that ListT m monad violates this law in general
(though it satisfies it for some particular monads m). For example,
I went through this example in quite a bit of detail a while ago and
wrote it up here:
On Dec 14, 2007 12:12 PM, Andrew Coppin [EMAIL PROTECTED] wrote:
Today, with a few import statements and compiler switches, the
exact same code takes 0.05 seconds. Tomorrow, who knows? Maybe I'm being
overly optimistic, but... ;-)
There have been some great improvements in array handling
On Dec 10, 2007 4:51 AM, Daniel Fischer [EMAIL PROTECTED] wrote:
Am Montag, 10. Dezember 2007 10:36 schrieb Ketil Malde:
Daniel Fischer [EMAIL PROTECTED] writes:
Various other people write:
... lots of talk about monads and IO ...
When someone comes to me and says I have this Python
On Dec 10, 2007 11:00 AM, Henning Thielemann
[EMAIL PROTECTED] wrote:
Does Haskell need quickdirty hackers?
The question isn't Does Haskell need quickdirty hackers? It's
would we get better software (using your favourite metric) if we put
Haskell into the hands of quick and dirty hackers?. I
On Dec 3, 2007 10:05 PM, David Benbennick [EMAIL PROTECTED] wrote:
Could you please post your code here when you're done? I'd be
interested to see the final result.
This is just experimental code I'm playing with in order to implement
exact real arithmetic, so there'll never be a final result
There's a bit of work required to make this code good enough for
general consumption, and I don't know much about Haskell internals.
(1) What is the official way to find the size of a word? A quick
look at 6.8.1's base/GHC/Num.lhs reveals that it uses a #defined
symbol.
(2) Is it safe to assume
On Dec 3, 2007 1:09 PM, Denis Bueno [EMAIL PROTECTED] wrote:
I don't think I can conclude that there are *no* reasons to teach the
do-notation first. I just think that it is more instructive to teach
it later.
It's standard in mathematics teaching, when introducing a mathematical
structure
On Dec 3, 2007 3:54 PM, Ben Franksen [EMAIL PROTECTED] wrote:
I don't buy this. As has been noted by others before, IO is a very special
case, in that it can't be defined in Haskell itself, and there is no
evaluation function runIO :: IO a - a.
I'm not sure what a function of type m a - a has
Is there anything in any of the interfaces to Integer that will allow
me to quickly find the highest bit set in an Integer? If not, does
anyone have any recommendations for how to do it efficiently. There
are some obvious things that come to mind but which might involve
quite a bit of useless
On Dec 3, 2007 6:36 PM, Ben Franksen [EMAIL PROTECTED] wrote:
then the special features of IO
will remain associated with monads in general, leading to a whole jumble of
completely wrong ideas about them.
As I only learnt about monads a couple of years ago, the process is
still fresh in my
On Dec 3, 2007 9:10 PM, Don Stewart [EMAIL PROTECTED] wrote:
Is there anything in any of the interfaces to Integer that will allow
me to quickly find the highest bit set in an Integer?
Well, you could use testBit, which is pretty efficient,
But testBit tests only one bit at a time. To prove
On Dec 3, 2007 9:32 PM, Sterling Clover [EMAIL PROTECTED] wrote:
if all else fails, be determined by unpacking it
into the primitives, which are (# Int#, ByteArr# #) with the Int# as
the number of limbs of the integer, as well as its sign.
That's the answer I'm looking for, thanks.
--
Dan
On Nov 28, 2007 9:20 PM, Chris Smith [EMAIL PROTECTED] wrote:
I intend to naively treat each function as being from the reals to the
reals, and then take advantage of the fact (which is proven by the type
system in the code I posted) that when the derivative is evaluated at
integer inputs for
Chris,
So I want the parameter to be more restricted. No one is going to write
a function that *only* works on AD types.
But exporting AD doesn't force people to write functions that work on
AD types, people can write whatever functions they like. They're only
constrained if they want to pass
Chris,
I could change my implementation; I could use Jerzy's
implementation...launch Mathematica...
But all of these could be implemented by introducing a different type
constructor called AD for each one. You could switch the
implementation of AD on the user and they wouldn't have to change a
On Nov 13, 2007 3:00 AM, Simon Peyton-Jones [EMAIL PROTECTED] wrote:
Dan, can you suggest any words we could add to the
documentation that would have prevented you stumbling?
I guess the thing that would have helped best would have been an error
message like 'x' not in scope,
On Nov 13, 2007 1:24 PM, Ryan Ingram [EMAIL PROTECTED] wrote:
I tend to prefer where, but I think that guards function declarations are
more readable than giant if-thens and case constructs.
Up until yesterday I had presumed that guards only applied to
functions. But I was poking about in the
... linking ... done.
Ok, modules loaded: Main.
Prelude Main main
1
Prelude Main x
interactive:1:0: Not in scope: `x'
Prelude Main Leaving GHCi.
---
On Jul 23, 2007 10:46 AM, Dan Piponi [EMAIL PROTECTED] wrote:
Ian said:
Can you please give
On Nov 12, 2007 1:59 PM, Henning Thielemann
[EMAIL PROTECTED] wrote:
See
http://www.haskell.org/ghc/docs/latest/html/users_guide/interactive-evaluation.html
I guess the key sentence is:
For technical reasons, GHCi can only support the *-form for modules
which are interpreted, so compiled
This isn't a question specific to ghc. In general, the process of
bootstrapping compilers and porting them to new platforms can be
described by T-diagrams. When I did a web search on T-diagrams the
first hit I found,
1 - 100 of 223 matches
Mail list logo