Hello Tomasz,
Friday, July 14, 2006, 9:31:32 AM, you wrote:
There might be issues with tuples though, for example (1,2,) would be
the (,) tuple and not the (,,) tuple, which is a bit weird.
Besides, it might be a bit more natural if (1,2,) was a shorthand for
(\x - (1,2,x))
in haskell-prime
Has anyone built Ashley's Data.Time package on Windows? I ask because
timestuff.c fails to compile for me because it refers to fields
(tm_zone, tm_gmtoff) in struct tm which don't seem to exist on Windows
(at least, mingw).
Alistair
___
Haskell-Cafe
Oleg and I are pleased to announce the release of a new version of Takusen
(it's been a while; so long that we don't remember the last version number
we used).
The most significant code change is a new internal design (courtesy of Oleg)
which gives better separation of concerns like statement
I'll answer my own post to elaborate:
If Day (and Month) where NOT instances of Bounded, the following would
be possible:
[Monday .. Sunday]
= should return [Monday, Tuesday ... Saturday, Sunday]
= but returns []
[Saturday .. Tuesday]
= should return [Saturday, Sunday, Monday, Tuesday]
= but
On Fri, 14 Jul 2006, Johan Holmquist wrote:
I'll answer my own post to elaborate:
If Day (and Month) where NOT instances of Bounded, the following would
be possible:
[Monday .. Sunday]
= should return [Monday, Tuesday ... Saturday, Sunday]
= but returns []
Why not
[Monday, Tuesday
On Fri, 14 Jul 2006, Bulat Ziganshin wrote:
Hello Tomasz,
Friday, July 14, 2006, 9:31:32 AM, you wrote:
There might be issues with tuples though, for example (1,2,) would be
the (,) tuple and not the (,,) tuple, which is a bit weird.
Besides, it might be a bit more natural if
Johan Holmquist [EMAIL PROTECTED] wrote:
If Day (and Month) where NOT instances of Bounded, the following would
be possible:
[Saturday .. Tuesday]
= should return [Saturday, Sunday, Monday, Tuesday]
= but returns []
This does seem like a reasonable argument to me. Some enumerations are
Try this:
module Cycle (Cyclic(..)) where
import System.Time
import Data.Word
import Data.Int
class (Eq c,Enum c, Bounded c) = Cyclic c where
cyclePeriod :: c - Int
cyclePeriod _ = fromEnum (maxBound :: c) - fromEnum (minBound :: c) + 1
succCycle :: c - c
succCycle c | c ==
Hmmm... I think I should have said:
toCycle :: Int - c
toCycle = toEnum
. (+ (fromEnum (minBound::c)))
. (`mod` (cyclePeriod (undefined::c)))
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Okay...final version attached.
This one fixes the toCycle bugs and changes from Int to Integer so overflow is
no longer an issue.
The result of cycleFromThenTo fits what I would expect, but you are free to drop
this or adapt it.
cycleFrom and cycleFromTo and cycleFromThen are easy, since
Henning Thielemann schrieb:
in haskell-prime list there was a proposal to use '?' for such things:
(1,2,?)
only problem is what it's hard to define exactly where the lambda
should arise:
the placeholder '?' becomes part of a new implicit identifier (that
exceeds Haskell's identifier
Yes, it would be possible to make ones own class and instantiate from
that. I was just thinking Day and Month should be cyclic per default.
from Henning Thielemann:
Since the days are cycling, what is more natural about your result
compared to my one?
I would prefer the one without any
On Fri, 14 Jul 2006, Christian Maeder wrote:
Henning Thielemann schrieb:
in haskell-prime list there was a proposal to use '?' for such things:
(1,2,?)
only problem is what it's hard to define exactly where the lambda
should arise:
the placeholder '?' becomes part of a new
On Fri, 14 Jul 2006, Johan Holmquist wrote:
from Henning Thielemann:
Since the days are cycling, what is more natural about your result
compared to my one?
I would prefer the one without any repetitions.
I assume the Bounded instance exists in order to allow loops like
liftM2 (,)
Alistair Bayley wrote:
Has anyone built Ashley's Data.Time package on Windows? I ask because
timestuff.c fails to compile for me because it refers to fields
(tm_zone, tm_gmtoff) in struct tm which don't seem to exist on Windows
(at least, mingw).
Yes, I made it work on Windows recently. The
Interestingly, your Cyclic class idea may have practical purposes
beyond enumeration. Integers modulo some number are also cyclical,
and can come in very handy. In fact, raw unsigned ints are modulo
2^32 (or something like that), so they really ought (under one
interpretation) to be members of
On 14/07/06, David Roundy [EMAIL PROTECTED] wrote:
Anyhow, just thought I'd mention that
this isn't useful only for ordinary cyclic objects like dates.
Correct. Which is why Chris Kuklewicz included instances for, e.g., Int :)
I think this would be a great class to have in the standard libs.
On 14/07/06, Johan Holmquist [EMAIL PROTECTED] wrote:
You mean [Monday, Tuesday ... Sunday, Monday] ?
Actually not. No repetitions.
That seems like a very bad idea. '..' normally means 'inclusive',
breaking those semantics would be a very weird thing to do, and breaks
the principle of least
David House wrote:
On 14/07/06, David Roundy [EMAIL PROTECTED] wrote:
Anyhow, just thought I'd mention that
this isn't useful only for ordinary cyclic objects like dates.
Correct. Which is why Chris Kuklewicz included instances for, e.g., Int :)
And the new version takes everything to
On Fri, Jul 14, 2006 at 02:28:20PM +0100, David House wrote:
On 14/07/06, David Roundy [EMAIL PROTECTED] wrote:
Anyhow, just thought I'd mention that
this isn't useful only for ordinary cyclic objects like dates.
Correct. Which is why Chris Kuklewicz included instances for, e.g., Int :)
Ah,
Henning Thielemann schrieb:
I have seen $f(\cdot)$ instead of $f$ really often, as well as
$f(\cdot-k)$ for \x - f(x-k).
yes, but for first order functions only. Then parens can be seen as part
of the identifier (as I showed for tuples before).
Christian
Friends,
Phil Wadler, John Hughes, Paul Hudak and I have been writing a paper
about the
The History of Haskell
We've submitted an earlier draft to the History Of Programming Languages
conference (HOPL'07), and it's been accepted. We have to submit a
more-or-less final draft by 1
Hi,
trying to put WashNGo-2.9 to a nontrivial prototyping job
gave some very compelling results so far, but also got me
stumped on occasions. I'd be grateful for some guidance on
the following points, concerning abstract tables mainly.
* selectionDisplay: looks like displayFun (fourth arg)
On Thu, 13 Jul 2006, Ferenc Wagner wrote:
...
Second, I find no trace of SSL/TLS routines. Is that really
left out, or do I overlook something?
OpenLDAP supports an option LDAP_OPT_X_TLS --
ldap_set_option Nothing LDAP_OPT_X_TLS LDAP_OPT_X_TLS_DEMAND
...
ldapconnection -
Hello Simon,
Friday, July 14, 2006, 7:21:26 PM, you wrote:
The History of Haskell
how about naming it Haskell: lazy programmer's language ? :)
--
Best regards,
Bulatmailto:[EMAIL PROTECTED]
___
Haskell-Cafe
On Mon, Jun 19, 2006 at 05:50:13PM +0100, Duncan Coutts wrote:
On Mon, 2006-06-19 at 17:03 +0100, Jon Fairbairn wrote:
il [] = error foo
il [x] = ([], x)
il (x:xs) = cof x (il xs)
where cof x ~(a,b) = (x:a, b)
-- !
From a quick test, it looks like
Yep, that's its codename.
Now, I'm not much of a Windows person. Is the name just a weird
coincidence, or does it have anything to do with monads as we know
them?
http://en.wikipedia.org/wiki/MSH_(shell)
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana -- Groucho Marx
Did you try putting this in a file, say, t.hsand running
ghci t.hs
then typing
:type func
at the GHCi prompt? It should tell you the function type.
Jared.
On 7/14/06, Jenny678 [EMAIL PROTECTED] wrote:
Hallo
Can somebody tell me the type of the following function?
func ::
(leave off the line with
func :: ???
and the compiler will figure it out for you, if possible---it works in
this case)
Jared.
On 7/14/06, Jared Updike [EMAIL PROTECTED] wrote:
Did you try putting this in a file, say, t.hsand running
ghci t.hs
then typing
:type
Tim Docker wrote:
These layouts feel a bit artificial to me. I am quite partial to
python's
list syntax - a trailing comma is optional. meaning you can write
[
a,
b,
c,
]
I'm surprised this approach isn't more widespread - Are there reasons
why
haskell syntax could
Adding some code to go along with my last post:main = do [tree] - runX (readDocument [(a_validate, 0)]
text.xml) [fooDoc
] - runX (constA tree processChildren isFoo) [expanded] - runX (constA tree processTopDown (expandNode fooDoc `when` hasName bar))
[status] - runX (constA expanded
31 matches
Mail list logo