Vector Fabrics has another position open for a functional programmer. See below
and http://www.vectorfabrics.com/company/career/functional_programmer for
details.
This time, we particularly welcome applications from experienced developers,
the position providing a fair share of opportunities
Hi all,
The last days, some spam was added to the GHC developer wiki
(http://hackage.haskell.org/trac/ghc) .
I have removed some of it, but I could not get rid of the bits that were added
through attachments; see for example the bottom of
http://hackage.haskell.org/trac/ghc/wiki/Building.
[Apologies for multiple postings.]
Vector Fabrics is hiring: we are looking for a top-notch programmer to
extend our program-analysis and parallelization products. You design
and implement algorithms to assist the programmer to create a parallel
design from a sequential C or C++ program. You
I am almost sure this is a known issue, but I noticed some erroneous (?)
interaction between datatype promotion and existential quantification. Consider
the following program:
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GADTs
Romildo,
How should an instance of (Functor ExprF) be defined? It is not shown in
the thesis.
It's actually quite straigtforward:
instance Functor ExprF where
fmap _ (Num n) = Num n
fmap _ (Var x) = Var x
fmap f (Bin op l r) = Bin op (f l) (f r)
As expected you get:
Romildo,
I could write the (Functor ExprF) instance:
instance Functor ExprF where
fmap f expr = case expr of
Num n - Num n
Var v - Var v
Bin op x y - Bin op (f x) (f y)
Yes, excellent. That'll do.
Cheers,
Stefan
Wren, Sjoerd,
This is not just about map, but it also a problem for the Monoid instance.
You are basically adding an extra identity element, 0, to the max monoid,
which works but is weird.
Still that's how union is typically defined for hybrid sets. It's what
happens if want union and
Sjoerd,
I am sorry, as I already wrote, I decided to deprecate the package.
[3] defines the union as h(u) = max(f(u), g(u)) where f, g and h are
multiplicity functions.
Which is the same, as [3] is about multisets, not signed multisets.
[...] and this is also what your implementation does.
Sjoerd,
[3] defines the union as h(u) = max(f(u), g(u)) where f, g and h are
multiplicity functions.
Which is the same, as [3] is about multisets, not signed multisets.
Chapter 3 of [3] is about Hybrid Sets.
And there the union is defined by taking the *minimum* of multiplicities, which
Sjoerd,
I have a hard time believing you have implemented the semantics that people
have agreed on to be a sensible semantics for hybrid sets.
Noted.
Cheers,
Stefan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Sjoerd,
For a specific example, I haven't the faintest intuition about
what 'map' should do. Suppose we have
{(k1)x1, (k2)x2}
and f x1 == f x2 = y. Should the value of map f {...} be
{(k1+k2)y} or {(k1`max`k2)y} or what?
I don't think max would be a good choice, as that would mean
Sjoerd,
This is not just about map, but it also a problem for the Monoid instance.
You are basically adding an extra identity element, 0, to the max monoid,
which works but is weird.
Still that's how union is typically defined for hybrid sets. It's what happens
if want union and empty to
Sjoerd,
This is not just about map, but it also a problem for the Monoid instance.
You are basically adding an extra identity element, 0, to the max monoid,
which works but is weird.
Still that's how union is typically defined for hybrid sets. It's what
happens if want union and empty to
Sjoerd,
Then why would you want that?
You don't have to. (SignedMultiset a, additiveUnion, empty) gives you the
Monoid that you seem to have a preference for. The library supplies it
through the Additive wrapper. The point is that you have a choice: different
applications may ask for
Richard,
Thanks for your excellent feedback! Very helpful!
Signed multisets are unfamiliar to most of us, and I for one found the paper
a little fast-paced. Can you put a bit more into the documentation?
Definitely. That's what weekends are for... :) I'll add some sections to the
Wren,
For a specific example, I haven't the faintest intuition about
what 'map' should do. Suppose we have
{(k1)x1, (k2)x2}
and f x1 == f x2 = y. Should the value of map f {...} be
{(k1+k2)y} or {(k1`max`k2)y} or what?
Good question. I'd suppose that they should be parametrized by
Release early, release often. Here's a second version:
http://hackage.haskell.org/package/signed-multiset-0.2
Changes:
* Added the functions Data.SignedMultiset.isPositive and
Data.SignedMultiset.isNegative, which return whether all elements in a
signed multiset have respectively
Jacques,
In the literature, we have found [1] that these are sometimes also called
'hybrid sets'.
They also go by the name of 'shadow sets', which also has a cool ring to it. ;)
PS: the Haddock did not work for 0.2, but did for 0.1, you might want to look
into that.
As I just uploaded
Ivan,
This package provides an efficient implementation of so-called
signed multisets, which generalise multisets by allowing for
negative membership.
That is, elements in a signed multiset can have negative multiplicities.
Wait, something can be not in the multiset more than once? :o
Johannes,
This package provides an efficient implementation of so-called
signed multisets, which generalise multisets by allowing for
negative membership.
SignedMultiset a = Data.Map.Map a Integer
Indeed.
so what do I gain by using your library?
(what is the API difference?)
The library
I am pleased to announce the first release of signed-multiset, which implements
an abstract datatype for multisets with negative membership.
The package can be obtained from
http://hackage.haskell.org/package/signed-multiset-0.1
As always, feedback is welcome.
Cheers,
Stefan
Martin,
importFile :: Editor - String - IO ()
importFile ed path = do
s - readFile path
ps - mapM (\x - makePair (x, )) (lines s)
es - return $ V.fromList ps
writeIORef ed es
loadFile :: Editor - String - IO ()
loadFile ed path = do
s - readFile path
ps - mapM makePair
Martin,
(The trick with `flip` is tempting, but again at the
cost of having to peer rather too closely at the implementation of
processFile when reading the code).
That trick is of course completely orthogonal. One could just as well write:
processFile :: (String - [a]) - (a - (String,
Martin,
Quick question: what's the difference between
importFile ed = readfile = fromRawFile = setEditor ed
and
importFile = readfile = fromRawFile = setEditor
that the former compiles but the latter doesn't?
Note that, in Haskell, function application has higher priority then any
David,
Conor wrote:
But the news is not all bad. It is possible to add some eta-rules
without breaking the Geuvers property (for functions it's ok; for
pairs and unit it's ok if you make their patterns irrefutable).
Note that, in Haskell, for functions it's only ok if you leave seq and the
Mark,
Whether a variable is bound or free depends on the scope under consideration. In
(\x. x) (\y. x)
the variable x is bound in \x. x, but free in \y. x; hence, it's free in (\x.
x) (\y. x) as a whole. However, in
\x. (\x. x) (\y. x)
it's bound...
HTH,
Stefan
Chris,
I'm not a native English speaker and recently I was wondering about the two
words order and ordering (the main reason why I write this to the Haskell
mailing list, is that the type class Ordering does exist).
Irrelevant to your struggle, but note that the *type class* is dubbed Ord,
David,
Ryan Ingram wrote:
Haskell doesn't have true type functions; what you are really saying
is
instance Monad (\v - Vect k (Monomial v))
Daniel Fischer wrote:
I think there was a theoretical reason why that isn't allowed (making type
inference undecidable? I don't remember, I don't
Wolfgang,
We should definitely get rid of these Is* class identifiers like
IsString and IsList. We also don’t have IsNum, IsMonad, etc.
I see your point. For strings, however, there was of course never the
possibility to dub the class String as that name is already taken by the type
synonym.
Bulat,
btw, i also had proposal to automatically convert typeclasses used in
type declarations into constraints, [...]
Together with proposals i mentioned previously, it will allow to treat
existing code dealing with lists/strings as generic code working
with any sequential container type
Janis,
So, basically, we are annotating function
types, what is IIRC exactly what Janis and David are doing. (I hope
Janis corrects me if I'm wrong here).
Wrong only in that David's name is Daniel. :-)
Ah, I am terribly sorry. I just shouldn't type e-mails after having no more
than a
Nicolas,
OK, I better understand now where we disagree. You want to see in the type
whether or not the free theorem apply, I want them to always apply when
no call to unsafe function is made.
Implementing your suggestion would make me feel uncomfortable. Turning seq into
an unsafe operations
types in Eval would indeed make parametricity
less of an issue, but I do not quite agree that the cases in which one may
need seq on values of function type are insignificant.
Cheers,
Stefan
[*] Stefan Holdermans and Jurriaan Hage. Making “stricterness” more relevant.
In John P. Gallagher
Brandon,
Hm. Seems to me that (with TypeFamilies and FlexibleContexts)
h :: (x ~ y, Eval (y - Int)) = (x - Int) - (y - Int) - Int
should do that, but ghci is telling me it isn't (substituting Eq for Eval
for the nonce):
Prelude let h :: (x ~ y, Eq (y - Int)) = (x - Int) - (y - Int) -
Brandon,
h :: (x ~ y, Eval (y - Int)) = (x - Int) - (y - Int) - Int
But actually if you push the constraint inward, into the type so to say, you
actually get quite close to Janis' and David's solution.
Sorry, I was thinking out loud there. I meant the Eval constraint, not the
equality
Brandon,
Sorry, I was thinking out loud there. I meant the Eval constraint, not the
equality constraint. But, right now, I guess my comment only makes sense to
me, so let's pretend I kept quiet. ;-)
The point of this discussion is that the Eval constraint needs to be on one
of the
Nicolas,
I would deeply in favor of renaming seq to unsafeSeq, and introduce a
type class to reintroduce seq in a disciplined way.
There is a well-documented [1] trade-off here: Often, calls to seq are
introduced late in a developing cycle; typically after you have discovered a
space leak
Jason,
There is one case where you can break out of a monad without knowing which
monad it is. Well, kind of. It's cheating in a way because it does force
the use of the Identity monad. Even if it's cheating, it's still very clever
and interesting.
How is this cheating? Or better, how
Martijn,
In fact, I would argue that a monad which you cannot escape from is not very
useful at all. IO is the only exception I know of.
And that's only because, at least the runtime system allows for execution of a
computation inside the IO monad at top-level.
Cheers,
Stefan
Alexey,
There is one case where you can break out of a monad without knowing which
monad it is. Well, kind of. It's cheating in a way because it does force
the use of the Identity monad. Even if it's cheating, it's still very
clever and interesting.
How is this cheating? Or better, how
Ivan,
in `size` function, what does the `~` mean ?
A lazy pattern match: http://en.wikibooks.org/wiki/Haskell/Laziness
(there is a better name for it, but I can't remember).
Irrefutable pattern? ;-)
Cheers,
Stefan
___
Haskell-Cafe mailing list
Martijn,
Ryan wrote:
Unfortunately, this makes things like
infinite_xs - sequence (repeat arbitrary)
no longer work, since the state never comes out the other side.
You replied:
You're asking to execute an infinite number of monadic actions. How
can this ever terminate at all?
There
Patrick,
It seems that I need to distinguish between a theory for Haskell and a
given implementation (GHCi).
What do you mean by this?
Obviously I get two different types
Wrong. You get exactly the same type, it's just that GHCi detected
that you have a fancy name for this type, so it
Dear Patrick,
From the responses to my query, it seems that I cannot rely totally on
the compiler for my research question which is concerned with the
meaning of Haskell constructs I will have to consult the Haskell
Report.
For both practical and theoretical matters, GHC provides a very
Stephen,
oo f g = (f .) . g
ooo f g = ((f .) .) . g
Why are these also called blackbird and bunting?
Thanks,
Stefan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
John,
It might be better to go about it in a fashion similar to how one
would use Haskell to create a new language using Happy, but instead
of making a full fledged language create a language that makes only
minor adjustments to the official language where most of the
original source
Eugene,
Consider the type: (forall a . a) - String.
It's of rank 2.
What is the definition of rank of a polymorphic type?
The minimal rank of a type is given by
rank (forall a. t) = 1 `max` rank t
rank (t - u) = (if rank t == 0 then 0 else rank t + 1) `max`
rank u
rank _
Eugene,
1) Does there exist an authoritative source saying the same? Not that
I'm doubting, just supposing that the source would have other
interesting information, too :)
You may want to have a look at the already mentioned JFP-article by
Peyton Jones et al. and perhaps the work of Kfoury
John, Miguel (and others),
Don Stewart wrote, the guarantees of purity the type system
provides are extremely
useful for verification purposes. My response to this is in
theory. This is what caught my attention initially, but the
language lacks polish and does not appear to be going in a
To feed, or not to feed: that is the question:
Whether 'tis nobler in the mind to suffer
The quips and ramblings of outrageous trolling,
Or to take arms against a sea of nonsense,
And by opposing end them?
Brilliant. Just brilliant.
+1
Cheers,
Stefan
So long as we bastardize the bard, we best bastardize him fully! :)
If only we could claim:
Though this be madness, yet there is method in 't.
Cheers,
Stefan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Tom,
I was wondering whether there are any universities that teach about
Haskell type families or GADTs?
I'm quite sure at least GADTs are covered in INFOMAFP, the graduate
course on Advanced Functional Programming at UU:
http://www.cs.uu.nl/docs/vakken/afp
Cheers,
Stefan
Answers to spec.
You didn't answered the homework question:
I don't know if this is homework.
I'm a bit suspicious: http://www.dcs.shef.ac.uk/intranet/teaching/modules/level2/com2010.html
.
See http://www.haskell.org/haskellwiki/Homework_help .
Cheers,
Stefan
Luke,
This is the typical bottled response to people asking for homework
help. But spot135 has done a good job so far: stated his problems,
shown his work so far, asking for guidance not answers. And the
community has done a good job helping: no answers, but hints and
leading questions. I
that the old version of the data will never be needed again,
and hence update it in-place. Making this kind of thing more
automatic could be interesting theoretically and practically.
[Warning: shameless plug follows.]
Have you had a look at our 2008 PEPM paper?
Jurriaan Hage and Stefan Holdermans
Erik,
http://people.cs.uu.nl/stefan/pubs/hage08heap.html
Getting connection refused on that.
Don't know: it still works for me.
Cheers,
Stefan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Manuel, Simon,
I've spotted a hopefully small but for us quite annoying bug in GHC's
type checker: it loops when overloading resolving involves a circular
constraint graph containing type-family applications.
The following program (also attached) demonstrates the problem:
{-# LANGUAGE
Dear Martin,
Your example must loop because as you show below
the instance declaration leads to a cycle.
By black-holing you probably mean co-induction. That is,
if the statement to proven appears again, we assume it must hold.
However, type classes are by default inductive, so there's no
Dear Martin,
By black-holing you probably mean co-induction. That is,
if the statement to proven appears again, we assume it must hold.
However, type classes are by default inductive, so there's no
easy fix to offer to your problem.
A propos: are there fundamental objections to coinductive
Conor,
I'm scared. What about this?
data EQ :: * - * - * where
Refl :: EQ x x
class Public x where
blah :: EQ x Fred
instance Public Fred where
blah = Refl
What happens when I say
newtype Jim = Hide Fred deriving Public
? I tried it. I get
blah :: EQ Jim Fred
It's clear that
Conor,
What happens when I say
newtype Jim = Hide Fred deriving Public
? I tried it. I get
blah :: EQ Jim Fred
Thinking of it; this *does* make sense in System FC. The newtype-
declaration gives you as an axiom
Hide :: Jim ~ Fred
To give an instance of Public for Jim, we have to
Kashyap,
Can someone please send me a working example based on the contents
posted in the URL below?
There's a small typo in the post: the definition of Proto should read
data Proto = Proto {a :: A, b :: B, c :: C}
The rest seems fine to me. (See below for an excerpt).
Cheers,
Stefan
Andrew,
That seems simple enough (although problematic to implement).
However, the Report seems to say that it matters whether or not the
bindings are muturally recursive [but I'm not sure precisely *how*
it matters...]
It means that functions can only be used monomorphically within
Christopher,
Wouldn't it be great if pattern variables could be used more than once
in a pattern? Like so:
foo [x,x,_,x] = The values are the same!
foo _ = They're not the same!
These are called nonlinear patterns. I think Miranda (a precursor of
Haskell, sort of) used to have
Petr,
If I want to make it a functor in the last type variable (b), I can
just define
instance Functor (X a) where
fmap f (X a b) = X a (f b)
But how do I write it if I want X to be a functor in its first type
variable?
Short answer: you can't. Easiest way to workaround is to define
Petr,
Short answer: you can't. Easiest way to workaround is to define a
newtype wrapper around your original datatype:
newtype X' b a = X' {unX' :: X a b}
instance Functor (X' b) where
fmap g (X' (X a b)) = X' (X b (g a))
Err
fmap g (X' (X a b)) = X' (X (g a) b)
Cheers,
Stefan
can be derived in Haskell:
Alexey Rodriguez, Stefan Holdermans, Andres Löh, and Johan Jeuring.
Generic programming with fixed points for mutually recursive
datatypes, 2009. To appear in the proceedings of the 14th ACM SIGPLAN
International Conference on Functional Programming, ICFP 2009
Paul,
Did you mean to say that const is strict in its first param and
lazy in its second (since const _|_ y = _|_)? Also, can you explain
your notation, how does a - {S} - b -{L} a indicate the
strictness? Why not just {S} a - {L} b - a?
I'm sorry for the confusion. Indeed, const, as the
Dear Paul,
This thread as well as your blog post is very interesting. Hopefully I
can add something more or less valuable to it.
On your blog, you mention that your scheme for run-time strictness
analysis doesn't work out because it'll have you force a function
first before you can find
Ryan,
Also, partial application + seq throws a wrench in things: [...]
You're absolutely right. I did not take into account the effects of
seq in my previous post. However, this is exactly the subject of a
paper I presented at TFP, two weeks ago. A revised version of the
paper will be
Paul,
In trying to follow your email I got a bit confused by your notation -
const :: a - b - a const x y = x could read a - {S} - b -
{L} a
Here, we have annotated the function-space constructor (-) with
information about whether the corresponding function is strict or
lazy in
Henry,
Jason pointed out:
You'd get fromEnum and toEnum. Which I think, would give you the
int mapping that you are after.
fromEnum :: Enum a = a - Int
toEnum :: Enum a = Int - a
To me, this would indeed seem the way to go for your particular example.
Moreover, as for generic producer
Henry,
Ah, pressed send way to early. Of course, the definition should change
a little as well:
convert :: Data a = Int - a
convert i = xwhere
x = fromConstr ( dataTypeConstrs (dataTypeOf x) !! (i - 1) )
Cheers,
Stefan
___
Jochem,
rationals n = (putStr . unlines . map show) (take n (nub [x % y |
y -
[1..], x - [1..y], x y]))
rationals n :: Integer - [Ratio]
I meant Integer - String obviously.
Er... what about
rationals :: Int - IO ()
? ;-)
To the original poster: next time, just leave the function
I'm sorry, there is no such animal as safe global installation,
in the sense of download this one package and do what it says.
Well I have been doing that for more then 10 years, it is one of the
functions any decent package management systems is designed to do.
Time to adopt another goodie
If we had been interested in raising fierce discussions about n+k
patterns or how and where cabal installs things, we could have easily
achieved the same effect with much less effort.
you mean that we should shoot up? :)
If the release of UHC contributes to whatever discussion regarding
Chris,
In the inferred type, there should be IxMap l instead of IxMap i,
does anybody know what I'm doing wrong?
Your calls to empty are just ambiguous.
Let's say I want to get a hold of an empty map for A :|: B for some
types A and B. And let's say that you've instance for A hanging
Isaac,
Does anyone know if it is possible to specify a default definition
for an
associated type synonym?
According to http://hackage.haskell.org/trac/ghc/wiki/TypeFunctionsStatus
defaults for associated types is still a TODO.
Cheers,
Stefan
Dear all,
I was doing a little experimentation with associated type synonyms and
ran into a small but unforeseen annoyance. The following, contrived,
example snippets illustrate my pain:
First, let us declare some of the simplest classes exhibiting
associated type synonyms that I can
Tom,
Thanks for your quick answer.
The problem is ambiguity. The type checker can't determine which val
function to use, i.e. which dictionary to pass to val.
I see. Still, maybe a type-error message in terms of good old
unresolved top-level overloading would be a bit more useful
terms can, at
any time, be replaced by its value without changing the meaning of the
program as a whole.
Cheers,
Stefan
-
[1] 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
Bernie wrote:
I discussed this with Rinus Plasmeijer (chief designer of Clean) a
couple of years ago, and if I remember correctly, he said that the
native code generator in Clean was very good, and a significant
reason why Clean produces (relatively) fast executables. I think he
said
of Jurriaan
Hage, Arie Middelkoop, and myself, presented at this year's ICFP
[*]---such an analysis is very similar to sharing analysis, which may
be used by compilers for lazy languages to avoid unnecessary thunk
updates.
Cheers,
Stefan
[*] Jurriaan Hage, Stefan Holdermans, and Arie
BH,
Is there a library function to take a list of Strings and return a
list of
ints showing how many times each String occurs in the list.
So for example:
[egg, egg, cheese] would return [2,1]
freq xs = map length (group xs)
HTH,
Stefan
___
Seth,
You asked:
Are Benjamin C. Pierce's _Types and Programming Languages_ and/or
_Basic
Category Theory for Computer Scientists_ suitable for self-study?
And Tim answered:
Graduate-level textbooks don't have answers in the back of the book,
as a rule. In TAPL, some of the questions
C++ : imperative language whose type system is a Turing-complete
functional language (with rather twisted syntax)
Haskell: functional language whose type system is a Turing-
complete logic programming language (with rather twisted
syntax)
Arie,
Ok, so when do I use nub instead of 'map head.group.sort' ?
Well, for one thing, |map head . group . sort| produces a sorted
list, wheras |nub| preserves the order of the input list.
Cheers,
Stefan
___
Haskell-Cafe mailing list
Conor's exercise:
To that end, an exercise. Implement a codata type
data{-codata-} Mux x y = ...
which intersperses x's and y's in such a way that
(1) an initial segment of a Mux does not determine whether the next
element is an x or a y (ie, no forced *pattern* of alternation)
(2)
I wrote:
I came up with [...]
apfelmus' solution is of course more elegant, but I guess it boils
down to the same basic idea.
Cheers,
Stefan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Thomas,
let x = ... in ...
is only equal
do x - ...; ...
in the Identity monad. Also, why would do be more primitive than
let. That way you would have to use monads everywhere. Also,
let is treated specially by the type checker (IIRC) and there are
many, many other reasons not
Jon,
However, I can't think how you might return physically identical
results when
possible in Haskell. Essentially, you need a higher-order map
function:
val id_map : ('a - 'a) - 'a t - 'a t
that returns its input when f x = x for every x. How might this
be done?
fmap :: (Functor
Jon,
This is a crazy idea I've been working on: overload the syntax x
y so it can
mean function application f x = f(x) or multiplication x y =
x*y. The
reason is simply that I appreciate the brevity of MLs function
application
but I also appreciate the brevity of Mathematica's
Jon,
This is a crazy idea I've been working on: overload the syntax x
y so it can
mean function application f x = f(x) or multiplication x y = x*y.
On a related (?) note, but definitely not what you're after: there
are constructor classes that allow you to lift function application
into
Dan,
If you want to enforce associativity just create your own Eq
instance and
make it a pattern there.
Could you elaborate on that? It's still early here and I've had only
one cup of of coffee yet.
Cheers,
Stefan
___
Haskell-Cafe mailing
Al,
Has there been any work on extending Haskell's type system with
structural subtyping?
Koji Kagawaga. Polymorphic variants in Haskell. In Andres Loeh,
editor, Proceedings of the 2006 ACM SIGPLAN Workshop on Haskell,
Portland, Oregon, USA, September 17, 2006, pages 37--47. ACM Press,
Brandon,
If I'm reading the reports correctly, the Ord instance was
actually added in the Haskell 1.1 standard, by changing the
definition of Bool from
data Bool = True | False
to
data Bool = True | False deriving (Eq, Ord, Ix, Enum, Text, Binary)
It's
data Bool = False | True
It
Ashutosh,
ERROR file:.\-as.hs:5 - Unresolved top-level overloading
*** Binding : main
*** Outstanding context : (Read c, Read b, Show c, Show b)
Add an type annotation:
main = do
j - readFile sig1.key
let (x,y) = (read j) :: (Int, Int)-- -
putStrLn (value=
True in principle. But if writing the spec is harder than writing
the actual program, all it means is you spend longer trying to
figure out how to express intuitively simple concepts using
advanced and very abstract and subtle predicate calculus.
As it turns out, Haskell sometimes makes a
Andrew,
Which is beautifully symmetric. Alternatively, you can think about
how you actually use it:
map :: ((a - b) - [a]) - [b]
I am not following here: what do you mean? Clearly, this is not a
valid typing for map. Moreover, modulo undefinedness, there are no
functions with this
map :: ((a - b) - [a]) - [b]
I am not following here: what do you mean? Clearly, this is not a
valid typing for map. Moreover, modulo undefinedness, there are no
functions with this typing.
map _ = []
Ah, well, and that one, of course... :-)
Cheers,
Stefan
1 - 100 of 189 matches
Mail list logo