Is there in Haskell a non monadic function of type a -> a -> Bool which
test for physical equality of two values? It would return True if only
if both values are the same object in memory.
For instance:
value1 = "good"
value2 = "good"
eq value1 value2 => False
value1 = "good"
value2 =
2010/6/28 José Romildo Malaquias :
> Is there in Haskell a non monadic function of type a -> a -> Bool which
> test for physical equality of two values? It would return True if only
> if both values are the same object in memory.
>
> For instance:
>
> value1 = "good"
> value2 = "good"
>
> eq val
On 28 Jun 2010, at 09:38, José Romildo Malaquias wrote:
> Is there in Haskell a non monadic function of type a -> a -> Bool which
> test for physical equality of two values? It would return True if only
> if both values are the same object in memory.
>
> For instance:
>
> value1 = "good"
> va
On Mon, Jun 28, 2010 at 08:51:45AM +0400, Victor Nazarov wrote:
> >
> >> What we get with this instances is following code.
> >>
> >> > main =
> >> > do print (sizeof :: Sizeof Word16)
> >>
> >> Let's try it.
> >>
> >> $ runhaskell this.lhs
> >> this.lhs:78:14:
> >> Couldn't match expected ty
I don't know the answer to your questions, but just wanted to note
that you will probably get a better response on the
glasgow-haskell-users mailing list.
http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/mailing-lists-GHC.html
-Brent
On Fri, Jun 25, 2010 at 08:56:09PM -0700, braver wrot
On Fri, Jun 25, 2010 at 02:26:54PM -0700, Walt Rorie-Baety wrote:
> I've noticed over the - okay, over the months - that some folks enjoy the
> puzzle-like qualities of programming in the type system (poor Oleg, he's
> become #haskell's answer to the "Chuck Norris" meme commonly encountered in
> M
On 6/27/10 21:52, Victor Nazarov wrote:
>> class Sizeable sizeable
>>where type Sizeof sizeable
>> sizeof :: Sizeof sizeable
This is where the type checker should complain. There is no valid way to
call sizeof, regardless of what instances are available.
The situation is similar t
Dear Haskellers,
As part of our project on Refactoring Functional Programs
http://www.cs.kent.ac.uk/projects/refactor-fp/
we are pleased to announce the availability of HaRe 0.6 (also known as
HaRe 28/06/2010), a snapshot of our Haskell Refactorer prototype. Apart
from bug-fixes, there are
On Sun, Jun 27, 2010 at 4:44 PM, Alexey Khudyakov
wrote:
> Dependent types would be nice but there isn't anything usable out there.
> Newtype wrapper parametrized by type level number works fine so far.
>
> If you interested sources are available here:
> http://bitbucket.org/Shimuuar/nvector
> htt
hi,
On 25.06.2010 11:07, corentin.dup...@ext.mpsa.com wrote:
Another couple of reflexions (sorry for monopolizing):
1. Since i am making a Nomic game, players will have to submit rules. These
rules will be written in a sub-set of haskell.
Instead of writing my own reader/interpreter, i'd like
On Mon, Jun 28, 2010 at 7:02 PM, Jake McArthur wrote:
> On Sun, Jun 27, 2010 at 4:44 PM, Alexey Khudyakov
> wrote:
>> Dependent types would be nice but there isn't anything usable out there.
>> Newtype wrapper parametrized by type level number works fine so far.
>>
>> If you interested sources ar
On 25.06.2010 11:07, corentin.dup...@ext.mpsa.com wrote:
2. For now, the game is more or less playable in GHCi. But my concern is:
When you use GHCi, you are in the IO monad, right? How to had state to this
monad?
I would like that the player can compose his rule in GHCi, and when he is
done,
While working this weekend on the Snap web framework, I ran into a
problem. Snap implements MonadCatchIO, so I thought I could just use
bracket to handle resource acquisition/release in a safe manner.
Imagine my surprise when bracket simply failed to run the release
action sometimes.
I quickly de
So is there a specific reason why Haskell isn't dependently typed then?
Or you could ask, So is there a specific reason why C isn't a functional
language?
More to the point, Haskell was a bit too frozen in stone when dependent type
theory reached the point of being implementable.
R
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 6/28/10 15:04 , Andrew Coppin wrote:
>> More to the point, Haskell was a bit too frozen in stone when dependent type
>> theory reached the point of being implementable.
>
> Right. So, in summary, the answer is "historical circumstance"?
>
> (I was
wren ng thornton wrote:
Andrew Coppin wrote:
I think I looked at Coq (or was it Epigram?) and found it utterly
incomprehensible. Whoever wrote the document I was reading was
obviously very comfortable with advanced mathematical abstractions
which I've never even heard of.
One of the things I
Claus -- cafe5 is pretty much where it's at. You're right, the proggy
was used as the bug finder, actually at cafe3, still using ByteString.
It would be useful to have a really tiny data source - no more than
100 entries per Map should be sufficient to confirm or reject hunches
about potentia
claus.reinke:
>
> To binary package users/authors: is there a typed version of binary (that
> is, one that records and checks a representation of the serialized type
> before actual (de-)serialization)? It
> would be nice to have such a type check, even though it
> wouldn't protect against missin
Brent Yorgey wrote:
As several people have pointed out, type-level programming in Haskell
resembles logic programming a la Prolog -- however, this actually only
applies to type-level programming using multi-parameter type classes
with functional dependencies [1] (which was until recently the only
Some docs are in a miserable state of being incomplete.
And then some programmers are in a miserable state of not respecting docs
when the docs are complete.
Why should anyone expect
deleteBy (>=) 5 [0..10]
to accomplish anything meaningful, if he/she respects the written docs?
Today someone
On 28/06/2010 20:02, Carl Howells wrote:
While working this weekend on the Snap web framework, I ran into a
problem. Snap implements MonadCatchIO, so I thought I could just use
bracket to handle resource acquisition/release in a safe manner.
Imagine my surprise when bracket simply failed to run
On Mon, Jun 28, 2010 at 10:02 PM, Carl Howells wrote:
> While working this weekend on the Snap web framework, I ran into a
> problem. Snap implements MonadCatchIO, so I thought I could just use
> bracket to handle resource acquisition/release in a safe manner.
> Imagine my surprise when bracket
On Sun, 27 Jun 2010, Henning Thielemann wrote:
Maybe I can combine splitAtLazy and (++) to a function like
splitAtAndAppend :: [x] -> ([a] -> [b]) -> ([a] -> [b]) -> [a] -> [b]
but I'm afraid I will need pairs temporarily and then I run into the same
problems.
I have now implemented a solut
On Mon, Jun 28, 2010 at 1:44 PM, Albert Y.C.Lai wrote:
> Why should anyone expect
>
> deleteBy (>=) 5 [0..10]
>
> to accomplish anything meaningful, if he/she respects the written docs?
I proposed the following solution:
http://lukepalmer.wordpress.com/2009/07/01/on-the-by-functions/
>
> Tod
On Monday, June 28, 2010 10:38:33 am José Romildo Malaquias wrote:
> Is there in Haskell a non monadic function of type a -> a -> Bool which
> test for physical equality of two values? It would return True if only
> if both values are the same object in memory.
IIRC "observable sharing" does simil
reallyUnsafePointerEquality :: a -> a -> Int#
but don't use as it can give both false negatives (i.e. GC in the middle of
evaluation) and false positives (that GC just finished and put one object
right where the other was.)
The better model to obtain what you want to use StableNames and seq and,
Hi all,
I'll admit, the original idea for this package was something to place in
ACME ;). However, it's goal is to solve a real problem: the lack of good
instances on the Either type. As a brief summary, Either has no Applicative
or Monad instances in the base library, has 2 reasonable definitions
There’s a history of rich debate and discussion on these issues coming
from the scheme world, where it takes the guise of implementing
unwind-protect in the presence of call/cc. Kent Pitman’s take is
presented here:
http://www.nhplace.com/kent/PFAQ/unwind-protect-vs-continuations-overview.html
Th
It looks like good work, but I would be hesitent about depending on a
package which pulled in both mtl and tranformers.
Maybe that's just superstition - I haven't tried it.
Antoine
On Jun 28, 2010 5:51 PM, "Michael Snoyman" wrote:
Hi all,
I'll admit, the original idea for this package was som
Hi,
Quick question about ghci: when I do this at the prompt:
ghci> :m +Control.Monad.Cont
I get
Ambiguous module name `Control.Monad.Cont':
it was found in multiple packages: mtl-1.1.0.2 monads-fd-0.0.0.1
Is there any way to fix this from within ghci (i.e. not involving
mucking wit
On Mon, Jun 28, 2010 at 2:32 PM, Don Stewart wrote:
> claus.reinke:
>>
>> To binary package users/authors: is there a typed version of binary (that
>> is, one that records and checks a representation of the serialized type
>> before actual (de-)serialization)? It
>> would be nice to have such a ty
In the case of 'deleteBy' we can improve an API.
deleteBy eq x xs == deletePred (eq x) xs
@deletePred pred xs@ removes the first element of @xs@ which satisfies a
predicate @p...@.
Your solution is more general. :)
On 28.06.10 22:44, Albert Y.C.Lai wrote:
And then some programmers are in a
Wow! great to see Haskellers from B'lore. I'll be interested too.
On Mon, Jun 21, 2010 at 10:00 AM, C K Kashyap wrote:
> Hi,
> I was wondering if it would be a good idea for the folks interested in
> Haskell in Bangalore to get together. Especially if there are folks at EGL,
> perhaps we could j
On Jun 28, 2010, at 2:29 PM, Luke Palmer wrote:
> I proposed the following solution:
>
> http://lukepalmer.wordpress.com/2009/07/01/on-the-by-functions/
Seconded! I always want xxxOn and I almost never (perhaps never*) want xxxBy
for xxx in sort, maximum, group and nub.
- Mark
(*) A
As far as I know, the only issue with depending on both is the conflicting
orphan Monad instance for Either. Can anyone either confirm or deny this?
On Tue, Jun 29, 2010 at 5:11 AM, Antoine Latter wrote:
> It looks like good work, but I would be hesitent about depending on a
> package which pull
On 29 June 2010 15:20, Michael Snoyman wrote:
> As far as I know, the only issue with depending on both is the conflicting
> orphan Monad instance for Either. Can anyone either confirm or deny this?
Since you're being naughty and using package-qualified imports, it
should be OK (in terms of worki
Albert Y.C.Lai writes:
> The doc of deleteBy states: "The deleteBy function behaves like delete, but
> takes a user-supplied equality predicate." A precondition is that the
> user-supplied predicate is an equality predicate. (>=) is not an equality
> predicate, be it in the layperson sense of "it
On Tue, Jun 29, 2010 at 8:24 AM, Ivan Miljenovic
wrote:
> On 29 June 2010 15:20, Michael Snoyman wrote:
> > As far as I know, the only issue with depending on both is the
> conflicting
> > orphan Monad instance for Either. Can anyone either confirm or deny this?
>
> Since you're being naughty and
On 29 June 2010 15:38, Michael Snoyman wrote:
>
>
> On Tue, Jun 29, 2010 at 8:24 AM, Ivan Miljenovic
> wrote:
>>
>> On 29 June 2010 15:20, Michael Snoyman wrote:
>> > As far as I know, the only issue with depending on both is the
>> > conflicting
>> > orphan Monad instance for Either. Can anyone
Excerpts from Albert Y.C.Lai's message of Mon Jun 28 15:44:34 -0400 2010:
> I propose that at each minor version of base, someone picks an implementation
> randomly.
This has actually been done, in a legitimate language implementation.
Check out:
http://web.mit.edu/~axch/www/scheme/choices/non-as
On Mon, Jun 28, 2010 at 07:44:34PM +, Albert Y.C.Lai wrote:
> I propose that at each minor version of base, someone picks an implementation
> randomly.
>
> Here is a more radical, less labour-intensive solution, if you don't mind a
> judicious, correctness-preserving use of unsafePerformIO: at
41 matches
Mail list logo