the first response was cagey, possibly
suspecting a homework question although it seems like an odd time for it.)
length not only does not look inside of the thunk, it *can't* look inside
it; all it knows is that it has a list, it specifically does *not* know what
that list can hold. So the only thing
michael rice wrote:
f x = length [head x]
g x = length (tail x)
Wouldn't both functions need to evaluate x to the same level, *thunk* :
*thunk* to insure listhood?
There is no need to insure listhood at run time, since Haskell is
statically typed.
Tillmann
Subtle stuff.
Thanks, everyone, for your patience. You've been VERY helpful. Great list!
Michael
--- On Sat, 7/31/10, Brandon S Allbery KF8NH allb...@ece.cmu.edu wrote:
From: Brandon S Allbery KF8NH allb...@ece.cmu.edu
Subject: Re: [Haskell-cafe] Laziness question
To: haskell-cafe@haskell.org
suspecting a homework question although it seems like an odd time for it.)
length not only does not look inside of the thunk, it *can't* look inside
it; all it knows is that it has a list, it specifically does *not* know what
that list can hold. So the only thing it can do is count the number
be evaluated?
Exactly. (I was being cagey because the first response was cagey, possibly
suspecting a homework question although it seems like an odd time for it.)
length not only does not look inside of the thunk, it *can't* look inside
it; all it knows is that it has a list, it specifically
I have a question about finding the Gtk2Hs demos (the demos written in
Haskell).
To summarize what I have done so far:
I'm a new Cabal user; need to use Cabal in a Windows XP environment, where
it and the Haskell Platform are located on a network drive (H:) instead of
C:. (Need to be able to do
On 30 July 2010 13:32, Peter Schmitz ps.hask...@gmail.com wrote:
I have a question about finding the Gtk2Hs demos (the demos written in
Haskell).
They're not there:
http://osdir.com/ml/haskell-cafe@haskell.org/2010-07/msg00724.html
--
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
Rogan:
Again, thanks very much for your reply.
My situation is that I need to be able to use Cabal (and the Haskell
Platform, Gtk2Hs, etc.) at any of several PCs in a (Windows XP) LAN, each of
which has access to the network drive H:.
So, I am using:
H:\proc\tools\Haskell Platform
On 28 July 2010 23:46, Peter Schmitz ps.hask...@gmail.com wrote:
I will try experimenting with editing the config file and using that hidden
option you mentioned.
** Cabal experts:
If anyone knows how to do this sort of thing in a better way, I would
appreciate a word.
Rogan is right. You
Rogan is right. You just need to edit the cabal config file to point
to locations on your other drive.
I would suggest not relocating the config file itself. If you really
must do so then you can use the --config-file flag or the environment
variable CABAL_CONFIG.
Duncan
I will try
Rogan:
Thanks very much.
I began by downloading the latest gtk+ bundle from
http://www.gtk.org/download-windows.html
The instructions there said to just copy the files to any dir and add its
...\gtk\bin dir to my PATH, which I did, so that worked okay without admin
privs.
Given that I need to
On Tue, Jul 27, 2010 at 2:43 PM, Peter Schmitz ps.hask...@gmail.com wrote:
So, by default, cabal wants to put its config and updates on C:.
I looked at C:\Documents and Settings\pschmitz\Application Data\cabal\config
It has various references to C:, some commented out. E.g.:
Hi,
I'm stuck at page 151 of Real World Haskell and hoping that perhaps some
of you can give me a hand here...
The code that is giving me trouble is below.
data JValue = JString String
| JNumber Double
| JBool Bool
| JNull
| JObject [(String,
How about:
*Main fromJValue (JBool True) :: Either JSONError Bool
Right True
*Main
Doaitse
On 26 jul 2010, at 15:16, Angel de Vicente wrote:
data JValue = JString String
| JNumber Double
| JBool Bool
| JNull
| JObject [(String, JValue)]
On Monday 26 July 2010 15:16:36, Angel de Vicente wrote:
Hi,
I'm stuck at page 151 of Real World Haskell and hoping that perhaps some
of you can give me a hand here...
The code that is giving me trouble is below.
data JValue = JString String
| JNumber Double
|
Hi,
thanks for the answer. This is my first attempt at Typeclasses, and I
think there is something deep that I don't understand...
On 26/07/10 15:03, Daniel Fischer wrote:
class JSON a where
toJValue :: a - JValue
fromJValue :: JValue - Either JSONError a
instance JSON JValue
On Monday 26 July 2010 21:03:10, Angel de Vicente wrote:
Hi,
thanks for the answer. This is my first attempt at Typeclasses, and I
think there is something deep that I don't understand...
On 26/07/10 15:03, Daniel Fischer wrote:
class JSON a where
toJValue :: a - JValue
I have recently installed the Haskell Platform (for the first time) to a MS
Windows network drive; e.g.:
H:\aaa\bbb\Haskell Platform\2010.1.0.0\
I did so without admin privs.
It has ghc-6.12.1
I need to not install to C:.
I would like to install and use Gtk2Hs and Glade on the Platform also.
]
- at least, if you don't turn on some language extension(s).
That is the cause of many puzzlements and problems.
thanks for this, and for the detailed explanation on my previous
question. I keep a frosty Canarian beer for you in the fridge for
whenever we meet... :-)
I think that I can now
On Mon, Jul 26, 2010 at 2:06 PM, Peter Schmitz ps.hask...@gmail.com wrote:
I have recently installed the Haskell Platform (for the first time) to a MS
Windows network drive; e.g.:
H:\aaa\bbb\Haskell Platform\2010.1.0.0\
I did so without admin privs.
It has ghc-6.12.1
I need to not
On Jul 27, 2010, at 1:16 AM, Angel de Vicente wrote:
data JValue = JString String
| JNumber Double
| JBool Bool
| JNull
| JObject [(String, JValue)]
| JArray [JValue]
deriving (Eq, Ord, Show)
type JSONError = String
I am trying to document my parser library. In order to do so I should like to
include some example output in my haddock documentation. I fail to see however
how to get a block of output into the haddock part.
E.g.
-- | We can now run the parser @`pa`@ on input \a\, which succeeds:
-- @
I am trying to document my parser library. In order to do so I should like to
include some example output in my haddock documentation. I fail to see however
how to get a block of output into the haddock part.
E.g.
-- | We can now run the parser @`pa`@ on input \a\, which succeeds:
-- @
On Wednesday 21 July 2010 16:09:37, S. Doaitse Swierstra wrote:
I am trying to document my parser library. In order to do so I should
like to include some example output in my haddock documentation. I fail
to see however how to get a block of output into the haddock part.
E.g.
-- | We can
Unfortunately I get for input:
-- | We can now run the parser @`pa`@ on input \a\, which succeeds:
-- @
-- Result: \a\
-- Second line
-- @
the output
We can now run the parser pa on input a, which succeeds: Result: a Second
line
Doaitse
On 21 jul 2010, at 16:17, Daniel Fischer
On Wednesday 21 July 2010 16:23:48, S. Doaitse Swierstra wrote:
Unfortunately I get for input:
-- | We can now run the parser @`pa`@ on input \a\, which succeeds:
-- @
-- Result: \a\
-- Second line
-- @
the output
You need to separate the @'d paragraph from the rest of the comment by
S. Doaitse Swierstra doai...@cs.uu.nl writes:
Unfortunately I get for input:
-- | We can now run the parser @`pa`@ on input \a\, which succeeds:
-- @
-- Result: \a\
-- Second line
-- @
the output
We can now run the parser pa on input a, which succeeds: Result: a
Second line
.
Is it right to assume that magic is backed by FFI and cannot be done
in
pure Haskell?
On Mon, Jul 19, 2010 at 1:47 PM, Ketil Malde ke...@malde.org wrote:
C K Kashyap ckkash...@gmail.com writes:
I looked at State Monad yesterday and this question popped into my
mind.
From what I
C K Kashyap ckkash...@gmail.com writes:
I looked at State Monad yesterday and this question popped into my mind.
From what I gather State Monad essentially allows the use of Haskell's do
notation to invisibly pass around a state. So, does the use of Monadic
style fetch us more than syntactic
Okay...I think I am beginning to understand.
Is it right to assume that magic is backed by FFI and cannot be done in
pure Haskell?
On Mon, Jul 19, 2010 at 1:47 PM, Ketil Malde ke...@malde.org wrote:
C K Kashyap ckkash...@gmail.com writes:
I looked at State Monad yesterday and this question
Haskell?
On Mon, Jul 19, 2010 at 1:47 PM, Ketil Malde ke...@malde.org wrote:
C K Kashyap ckkash...@gmail.com writes:
I looked at State Monad yesterday and this question popped into my mind.
From what I gather State Monad essentially allows the use of Haskell's
do
notation to invisibly pass
On Mon, Jul 19, 2010 at 10:17 AM, Ketil Malde ke...@malde.org wrote:
At it's heart, monads are just syntactic convenience, but like many
other syntactic conveniences, allows you to structure your code better.
Thus it's more about programmer efficiency than program efficiency.
(The do notation
looked at State Monad yesterday and this question popped into my
mind.
From what I gather State Monad essentially allows the use of Haskell's
do
notation to invisibly pass around a state. So, does the use of
Monadic
style fetch us more than syntactic convenience?
At it's heart, monads
...@gmail.com writes:
I looked at State Monad yesterday and this question popped into my
mind.
From what I gather State Monad essentially allows the use of Haskell's
do
notation to invisibly pass around a state. So, does the use of
Monadic
style fetch us more than syntactic convenience
Thanks Wren,
Thanks Dave ... a quick question though could you point me to an example
where I could build up my own in place modifiable data structure in Haskell
without using any standard library stuff?
For example, if I wanted an image representation such as this
[[(Int,Int.Int)]] - basically
Hi,
On 16/07/10 07:35, C K Kashyap wrote:
Haskell without using any standard library stuff?
For example, if I wanted an image representation such as this
[[(Int,Int.Int)]] - basically a list of lists of 3 tuples (rgb) and
wanted to do in place replacement to set the pixel values, how could I
Hi Claude,
Thanks a lot for the example.
Btw, is this where you are trying in-place replacement?
modifyAtIndex :: (a - a) - Nat - List a - List a
modifyAtIndex f i as =
let ias = zip nats as
g (Tuple2 j a) = case i `eq` j of
False - a
Hi,
I looked at State Monad yesterday and this question popped into my mind.
From what I gather State Monad essentially allows the use of Haskell's do
notation to invisibly pass around a state. So, does the use of Monadic
style fetch us more than syntactic convenience?
Again, if I understand
On Thursday 15 July 2010 18:02:47, C K Kashyap wrote:
Hi,
I looked at State Monad yesterday and this question popped into my mind.
From what I gather State Monad essentially allows the use of Haskell's
do
notation to invisibly pass around a state. So, does the use of Monadic
style fetch
On Thu, Jul 15, 2010 at 9:02 AM, C K Kashyap ckkash...@gmail.com wrote:
Hi,
I looked at State Monad yesterday and this question popped into my mind.
From what I gather State Monad essentially allows the use of Haskell's do
notation to invisibly pass around a state. So, does the use of Monadic
Thanks Daniel,
Better refactorability.
If you're using monadic style, changing from, say,
State Thing
to
StateT Thing OtherMonad
or from
StateT Thing FirstMonad
to
StateT Thing SecondMonad
typically requires only few changes. Explicit state-passing usually
requires more changes.
So,
to be done using FFI only?
On Thu, Jul 15, 2010 at 10:48 PM, David Leimbach leim...@gmail.com wrote:
On Thu, Jul 15, 2010 at 9:02 AM, C K Kashyap ckkash...@gmail.com wrote:
Hi,
I looked at State Monad yesterday and this question popped into my mind.
From what I gather State Monad
computation.
Dave
On Thu, Jul 15, 2010 at 10:48 PM, David Leimbach leim...@gmail.comwrote:
On Thu, Jul 15, 2010 at 9:02 AM, C K Kashyap ckkash...@gmail.com wrote:
Hi,
I looked at State Monad yesterday and this question popped into my mind.
From what I gather State Monad essentially allows
C K Kashyap wrote:
Thanks Daniel,
Better refactorability.
If you're using monadic style, changing from, say,
State Thing
to
StateT Thing OtherMonad
or from
StateT Thing FirstMonad
to
StateT Thing SecondMonad
typically requires only few changes. Explicit state-passing usually
requires more
* Vasili I. Galchin vigalc...@gmail.com [2010-07-02 23:51:09-0500]
Hello,
Suppose I have the following fragment of a posting:
Message: 3
Date: Fri, 2 Jul 2010 12:32:43 -0500
From: aditya siram aditya.si...@gmail.com
Subject: Re: [Haskell-cafe] How easy is it to hire Haskell
Hello,
Suppose I have the following fragment of a posting:
Message: 3
Date: Fri, 2 Jul 2010 12:32:43 -0500
From: aditya siram aditya.si...@gmail.com
Subject: Re: [Haskell-cafe] How easy is it to hire Haskell programmers
To: Andrew Coppin andrewcop...@btinternet.com
Cc:
Hello -
I just a day or so ago downloaded Hakell and am playing around with it, and
I came upon this problem with WinGHCi:
I am able to enter a multi-line do statement that works if I use brackets
and semi-colon like so:
Prelude :{
Prelude| let main2 = do {
Prelude| putStrLn Please enter your
On 1 July 2010 16:04, Christopher Tauss ctau...@gmail.com wrote:
Hello -
I just a day or so ago downloaded Hakell and am playing around with it, and
I came upon this problem with WinGHCi:
I am able to enter a multi-line do statement that works if I use brackets
and semi-colon like so:
Hi,
My understanding of functional dependencies is that they can be used to
ensure that one type depends on another type.
For example, the type of location depends could on the type of the
object at that location.
Consider two models
1) The location of an aircraft landing should have location of
On 01/07/10 12:37, Patrick Browne wrote:
Why do some cases such as 1) fail to run even if they are the only
instantiation.
-- 1) Compiles but does not run
instance LocatedAt Int String where
spatialLocation(1)=home
That instance is fine. I presume the problem is that you are trying
Neil,
Does the following sum up the situation?
The class Num has subclasses containing various numeric types and the
literal 1 is a value for one or more of those types.
Hence the Haskell compiler says the instance 1) is OK.
But at run time, without the quantified (1:Int), the 1 could of more
than
Patrick Browne patrick.bro...@dit.ie writes:
Why do some cases such as 1) fail to run even if they are the only
instantiation.
I think this is because literal numbers are polymorphic, i.e. a '1' in
your source code is shorthand for 'fromIntegral 1', which is a type of
Num a = a. Thus,
The class Num has subclasses containing various numeric types and the
literal 1 is a value for one or more of those types.
Well, the problem is not with subclasses, but with types.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On 01/07/10 13:11, Patrick Browne wrote:
Neil,
Does the following sum up the situation?
The class Num has subclasses containing various numeric types and the
literal 1 is a value for one or more of those types.
Hence the Haskell compiler says the instance 1) is OK.
But at run time, without the
On Mon, Jun 21, 2010 at 11:22 AM, Daniel Lyons fus...@storytotell.orgwrote:
Hi,
I'm having a little trouble figuring out precisely how to port the decision
tree code from the book Programming Collective Intelligence. You can see
the code here:
Hello Haskellers,
I am new to programming in Haskell and I am having trouble understanding
exactly when statements become evaluated. My goal is to try and measure how
long a computation takes without having to use a show function. The code I
am trying to use is below (taken in part from RWH
On 25 June 2010 10:57, Frank Moore fmo...@gmail.com wrote:
Hello Haskellers,
I am new to programming in Haskell and I am having trouble understanding
exactly when statements become evaluated. My goal is to try and measure how
long a computation takes without having to use a show function.
Thanks for the reply.
My main is now:
main = do
let as = [1..2e7] :: [Double]
start - getCurrentTime
let meanAs = mean as
let meanOver2 = meanAs `deepseq` meanAs / 2
end - getCurrentTime
putStrLn (show (end `diffUTCTime` start))
start - getCurrentTime
putStrLn (show meanOver2)
On 25 June 2010 11:19, Frank Moore frankmo...@math.cornell.edu wrote:
Thanks for the reply.
My main is now:
main = do
let as = [1..2e7] :: [Double]
start - getCurrentTime
let meanAs = mean as
let meanOver2 = meanAs `deepseq` meanAs / 2
end - getCurrentTime
putStrLn (show
On Friday 25 June 2010 02:57:31, Frank Moore wrote:
Hello Haskellers,
I am new to programming in Haskell and I am having trouble understanding
exactly when statements become evaluated. My goal is to try and measure
how long a computation takes without having to use a show function. The
Daniel,
This means *when meanOver2 is evaluated*, then evaluate (mean as).
Binding it in a let is lazy, so it won't be evaluated until it's needed
(for printing in this case).
Also note that (mean as) is a Double, so deepseq is just seq in this case
(but I suppose this is just a boiled down
Hello
Maybe permutation trees are a viable starting point?
See the paper Parsing Permutation Phrases which appears to be on CiteSeer.
Some slides are also here - the data type definitions and Functor
instance for permutation trees are on page 18 (pdf index page 19):
Hi,
I'm having a little trouble figuring out precisely how to port the decision
tree code from the book Programming Collective Intelligence. You can see the
code here:
http://code.google.com/p/memothing/source/browse/trunk/PCI/ch7/treepredict.py?r=29
The design issue is that this code depends
)
-- Now we wish to define optimized instances of GMapKey for
-- pairs of items that fit within a word.
-- The following answers Ryan Newton's question
-- Define our own product type, to avoid overlapping instances with the
-- general GMapKey for pairs
-- It's a newtype: it has no run-time overhead
question: Is this type too
general? Are there functions which are semantically non-boolean which fit
in that type
Actually, this type is *less* general, in that it has less members.
Consider, what boolean is represented by this?
q :: CB Int
q = (+)
Whereas the (forall a. a - a - a) must work
GMaps -- families of map implementations indexed by the key type --
are an example on the wiki:
http://www.haskell.org/haskellwiki/GHC/Type_families
I've been using something like this myself. It sure would be nice to
have a fully developed version on Hackage, and I may try to submit
this
Maybe you could check out the FTGL package for inspiration on using
the freetype as a conventional C library. I was going to try to write
a Hackage package but realised I know nothing about typography and had
to start reading the intro. on Freetype's homepage (which is pretty
good, actually).
.
Basically, I would like some function like this :
stringWidth :: Font - String - Double
charWidth :: Font - Char - Double
which take some appropriate font type, string or char, and gives me a
width (also height) in some given unit. I'd like it to take into
account appropriate kerning.
Question 1
On Tue, Jun 1, 2010 at 10:30 AM, Gery Debongnie
gery.debong...@gmail.com wrote:
3. Perform a reading of the font metrics file in the main program, put
the results into some FontMetrics object, and give that to stringWidth
:: FontMetrics - Font - String - Double. Pros : allow me to avoid
Hi Gery
There probably isn't a library to help - I've looked at extracting
TrueType font metrics myself but abandoned it - TrueType fonts have a
very complicated file format, and the spec is inadequate to code an
implementation. TeX font metrics are probably simpler but obviously
tied to TeX.
On Jun 1, 2010, at 10:53 , Stephen Tetley wrote:
There probably isn't a library to help - I've looked at extracting
TrueType font metrics myself but abandoned it - TrueType fonts have a
very complicated file format, and the spec is inadequate to code an
The saner way to do this is to write a
Hi Brandon
Even that's not simple - freetype is essentially a framework for
writing font processors rather than a conventional C library[*]. Saner
perhaps is to write a C program using freetype to do the exact job you
have in mind, then bind to your C program.
Best wishes
Stephen
[*} Probably
, the parameter 'a' is misleading. It has no connection to
the
'a's on the right of the equals sign. You might as well write:
type CB = forall a. a - a - a
Ah! That makes sense. Which raises a new question: Is this type too
general? Are there functiosn which are semantically non-boolean which fit
On Tue, Jun 1, 2010 at 12:40 PM, Cory Knapp cory.m.kn...@gmail.com wrote:
Thanks! That was exactly the sort of response I was looking for.
This explains why you need to double up for your current definitions. To
choose between two booleans (which will in turn allow you to choose
between
question: Is this type too
general? Are there functiosn which are semantically non-boolean which fit
in that type, and would this still be the case with your other suggestion
(i.e. cand p q = p (q t f) f )?
Because the type is universally quantified, any function with that
signature can only
in question, but I
think it just tends to confuse people who are new to this, especially since
holding a universal inside a datatype looks like:
data U = C (forall a. ...)
and removing the constructors to attempt to make it a type alias makes them
look identical:
type T = forall a. ...
type U
On Tuesday 01 June 2010 23:21:35, Dan Doel wrote:
I think SPJ is on record as saying it would add a lot of
complexity to the current GHC type system,
and I'm inclined to believe him.
In matters concerning the GHC type system, that's a fairly natural stance,
I think.
On Sat, May 29, 2010 at 9:28 PM, Cory Knapp cory.m.kn...@gmail.com wrote:
Hello,
A professor of mine was recently playing around during a lecture with
Church booleans (I.e., true = \x y - x; false = \x y - y) in Scala and
OCaml. I missed what he did, so I reworked it in Haskell and got this:
Jason Dagit wrote:
In Church's λ-calc the types are ignored,
Not so. Church-style lambda calculus is the one where types matter;
Curry-style is the one that ignores types and evaluates as if it were
the untyped lambda calculus.
Church encodings are based on the untyped LC rather than
On Sunday 30 May 2010 12:28:36 am Cory Knapp wrote:
type CB a = a - a - a
ct :: CB aC
ct x y = x
cf :: CB a
cf x y = y
cand :: CB (CB a) - CB a - CB a
cand p q = p q cf
cor :: CB (CB a) - CB a - CB a
cor p q = p ct q
The reason these types are required is that the 'a' in your
On Sun, May 30, 2010 at 4:08 AM, wren ng thornton w...@freegeek.org wrote:
Jason Dagit wrote:
In Church's λ-calc the types are ignored,
Not so. Church-style lambda calculus is the one where types matter;
Curry-style is the one that ignores types and evaluates as if it were the
untyped
Hello,
A professor of mine was recently playing around during a lecture with Church
booleans (I.e., true = \x y - x; false = \x y - y) in Scala and OCaml. I
missed what he did, so I reworked it in Haskell and got this:
type CB a = a - a - a
ct :: CB aC
ct x y = x
cf :: CB a
cf x y = y
cand ::
On Tue, May 25, 2010 at 10:46:47PM +0100, Stephen Tetley wrote:
Hi Eugene
You can store different things in a Map by collecting them with a
simple 'sum' type:
Hello, Stephen!
The records to be stored into a Map are not related to each other. So wrapping
them into another type is not very
Hello, all!
I'm trying to create set of polymorphic functions for working with custom
containers. I decided to try out typeclass and define generic function, which
uses the methods from the typeclass. The quick and naive solution is listed
below:
Hi Eugeny
Its not that GHC thinks you're doing something weird, but that there
is no relation between the type parameters in the Storage class. You
could use either functional dependencies or type families to introduce
a relation / relations, but personally I would look at doing something
simpler
On Tue, 25 May 2010, Eugeny N Dzhurinsky wrote:
I'm trying to create set of polymorphic functions for working with custom
containers. I decided to try out typeclass and define generic function, which
uses the methods from the typeclass. The quick and naive solution is listed
below:
There are
On Tuesday 25 May 2010 20:51:06, Eugeny N Dzhurinsky wrote:
Hello, all!
I'm trying to create set of polymorphic functions for working with
custom containers. I decided to try out typeclass and define generic
function, which uses the methods from the typeclass. The quick and naive
solution is
On Tue, May 25, 2010 at 07:59:24PM +0100, Stephen Tetley wrote:
Hi Eugeny
Its not that GHC thinks you're doing something weird, but that there
is no relation between the type parameters in the Storage class. You
could use either functional dependencies or type families to introduce
a
Hi Eugene
You can store different things in a Map by collecting them with a
simple 'sum' type:
import qualified Data.Map as Map
type DateTime = String-- just String for now..
type URL = String
type UniqueID = String
Here's the sum type:
data LogData = LastLogin DateTime
On May 23, 2010, at 2:53 AM, Lennart Augustsson wrote:
BTW, the id function works fine on bottom, both from a semantic and
implementation point of view.
Yes, but only because it doesn't work at all. Consider that calling
id undefined
requires evaluating undefined before you can call id.
Alexander Solla a...@2piix.com writes:
On May 23, 2010, at 1:35 AM, Jon Fairbairn wrote:
It seems to me relevant here, because one of the uses to which
one might put the symmetry rule is to replace an expression “e1
== e2” with “e2 == e1”, which can turn a programme that
terminates into a
That's totally false. You don't evaluate 'undefined' before calling 'id'.
(Or if you, it's because you've made a transformation that is valid
because 'id' is strict.)
On Mon, May 24, 2010 at 9:05 AM, Alexander Solla a...@2piix.com wrote:
Yes, but only because it doesn't work at all. Consider
Consider that calling
id undefined
requires evaluating undefined before you can call id. The program will
crash before you ever call id. Of course, the identity function should
have produced a value that crashed in exactly the same way. But we never got
there.
In which sense does id need
On Monday 24 May 2010 15:48:14, Jonas Almström Duregård wrote:
Consider that calling
id undefined
requires evaluating undefined before you can call id. The program will
crash before you ever call id. Of course, the identity function
should have produced a value that crashed in
Alexander Solla a...@2piix.com writes:
On May 22, 2010, at 1:32 AM, Jon Fairbairn wrote:
Since Bool is a type, and all Haskell types include ⊥, you need
to add conditions in your proofs to exclude it.
Not really. Bottom isn't a value, so much as an expression
for computations that don't
On May 23, 2010, at 1:35 AM, Jon Fairbairn wrote:
It seems to me relevant here, because one of the uses to which
one might put the symmetry rule is to replace an expression “e1
== e2” with “e2 == e1”, which can turn a programme that
terminates into a programme that does not.
I don't see how
For Bool, I'm not sure, but for, e.g., () it's certainly true.
Take this definition of ==
() == _ = True
Using case analysis of just the constructors, ignoring the value
bottom, you can easily prove symmetry.
But '() == undefined' terminates, whereas 'undefined == ()' does not.
Ignore bottom
On Sat, 2010-05-22 at 00:15 +, R J wrote:
I'm trying to prove that (==) is reflexive, symmetric, and transitive
over the Bools, given this definition:
(==) :: Bool - Bool - Bool
x == y = (x y) || (not x not y)
My question
R J rj248...@hotmail.com writes:
I'm trying to prove that (==) is reflexive, symmetric, and
transitive over the Bools, given this definition:
(==):: Bool - Bool - Bool
x == y = (x y) || (not x not y)
Since Bool is a type, and all Haskell types include ⊥, you need
to add conditions in
On May 22, 2010, at 1:32 AM, Jon Fairbairn wrote:
Since Bool is a type, and all Haskell types include ⊥, you need
to add conditions in your proofs to exclude it.
Not really. Bottom isn't a value, so much as an expression for
computations that don't refer to real values. It's close enough
801 - 900 of 4551 matches
Mail list logo