Forgot to reply all, as usual.
Пересылаемое сообщение
21.06.2013, 12:52, Miguel Mitrofanov miguelim...@yandex.ru:
Actually, this is not the real error you should care about. Try removing
FromJSON instance completely, and you'll get a lot more. And these are
fundamental: you
:t runMemLog (runTransitionT $ demo 1)
runMemLog (runTransitionT $ demo 1)
:: MonadLog (MemLog a) () = Log a - ((), [Command ()])
That means, that foo, if you manage to compile it, would have type MonadLog
(MemLog a) () = ((), [Command ()]). That means that in each call for foo it
would be
12.03.2013, 02:53, Richard A. O'Keefe o...@cs.otago.ac.nz:
On 12/03/2013, at 10:00 AM, MigMit wrote:
On Mar 12, 2013, at 12:44 AM, Richard A. O'Keefe o...@cs.otago.ac.nz
wrote:
Prelude :type (+)
(+) :: Num a = a - a - a
The predefined (+) in Haskell requires its arguments and its
My current project at work has a web interface. Therefore I needed an HTML
templating library. I've tried several and found them all unsatisfactory. Most
of them generate Haskell code from templates (with Template Haskell or a
separate utility), and I don't like metaprogramming; and recompiling
Hi Jan!
foldl always traverses the list to the end; in particular, if there is no end,
it would hang forever (unless the compiler is smart enough to detect an
infinite loop, in which case it can throw an error). On the other hand, if the
first argument is lazy enough, foldr would stop before
Hi cafe!
I'm a bit confused by the DefaultSignatures extension. It's unclear whether to
consider the following an example of clever use of this extension, or an
example of abuse of it:
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE FlexibleContexts #-}
{-#
Hi cafe!
The ConstraintKinds extension makes it possible to create classes of classes,
like this:
class F c where cfmap :: c f = (a - b) - f a - f b
instance F Functor where cfmap = fmap
instance F Monad where cfmap = liftM
So, basically we are saying that c is a class that has some special
22.02.2012, 11:20, wren ng thornton w...@freegeek.org:
On 2/22/12 1:45 AM, Miguel Mitrofanov wrote:
However, there is no free ordering on:
{ (a0,b) | b- B } \cup { (a,b0) | a- A }
What? By definition, since, a0= a and b0= b, we have (a0, b0)= (a0, b)
and (a0, b0)= (a0, b0), so
22.02.2012, 09:30, wren ng thornton w...@freegeek.org:
On 2/21/12 11:27 AM, MigMit wrote:
Ehm... why exactly don't domain products form domains?
One important property of domains[1] is that they have a unique bottom
element. Given domains A and B, let us denote the domain product as:
27.12.2011, 07:30, "Alexander Solla" alex.so...@gmail.com:And why exactly should we limit ourselves to some theory you happen to like?Because the question was about MY IDEAL. You're right. I'm confusing two different threads. My apologies.But (_|_) IS a concrete value.Um, perhaps in denotational
Now, what we can do with kl1? We can feed it an integer, say 1, and
obtain function f of the type s - (s,Bool) for an _unknown_ type s.
Informally, that type is different from any concrete type. We can
never find the Bool result produced by that function since we can
never have any concrete
Try
:t (foo 2, moo 2)
On 3 Aug 2011, at 23:31, Patrick Browne wrote:
Below are examples of using the sub-class context at class level and at
instance level.
In this simple case they seem to give the same results
In general, are there certain situations in which one or the other is
HTML emails considered harmful.
On 1 Jul 2011, at 23:17, Jack Henahan wrote:
'Courier New, 18pt' considered harmful?
On Jul 1, 2011, at 3:08 PM, Christopher Done wrote:
On 1 July 2011 20:51, Yves P limestr...@gmail.com wrote:
There is something that bothers me with that text, I can't
it works in
6.12 also), you'll see that the type of nextSum etc. is derived as Num a =
a.
On 20 Jun 2011, at 17:02, Serguey Zefirov wrote:
The fact is that (Num a) context works and (ToWires a, Num a) context
doesn't. At least in 6.12.1.
This still looks to me like a bug.
2011/6/19 Miguel
Seems like let-generalization is at work here.
Types of all values in the where section are inferred basically as if they
are declared at the top level. Therefore, inheritance fails without
NoMonomorphismRestriction.
There is a proposal (from Big Simon) to remove let-generalization:
Well, Maybe IS a monad, so I just use m prefix.
Отправлено с iPhone
Apr 22, 2011, в 21:14, Evan Laforge qdun...@gmail.com написал(а):
Here's a simple issue that's been with me for a while. As do many
people, I use plural variable names for lists, so if a Block as called
'block' then [Block]
As for Cont, it can be proved easily, either by hand, or by observation that
Cont is an obvious composition of two adjoint functors.
As for IO, it has to be taken for granted, since IO internals are hidden from
the programmer.
Отправлено с iPhone
Apr 12, 2011, в 14:39, Burak Ekici
I fail to see how does it limit the scope.
16.03.2011 15:05, Andrew Coppin пишет:
You could define a function:
withContainer ∷ (∀ s. Container s → α) → α
which creates a container, parameterizes it with an 's' that is only
scoped over the continuation and applies the continuation to the
Well, this code in C++ would probably work too:
Klass *k = new Klass(4,5);
delete k;
std::cout k-getY() std::endl;
though smart compiler would probably issue a warning. See, when you delete
something, C++ doesn't automagically mark your pointer as invalid; in fact,
it preserves all the data
length [c | x - [1..100], let c = chain x, length c 15]
16.02.2011 12:19, Tako Schotanus пишет:
Hello,
I was going through some of the tuturials and trying out different (syntactic)
alternatives to the given solutions and I I got to this line:
*length [chain x | x - [1..100] , length
Sorry, but last time I've checked, C did have loops, is that correct? And even
if you don't want loops, there is a preprocessor.
17.01.2011 10:45, Blake Rain пишет:
Dear Haskellers,
I thought I'd take some time to share something of my weekend with
you all. Not because of anything new,
On 17 Dec 2010, at 20:04, michael rice wrote:
I don't understand this error message. Haskell appears not to understand that
1 is a Num.
As it clearly states in the error message, it doesn't understand that [Int] is
a Num - and it's not.
No instance for Num something usually indicates that
Not sure if that's what you need:
data NodeF f = Node {name :: String, refs :: [f (NodeF f)]}
newtype Const a b = Const a
newtype Id a = Id a
type NodeS = NodeF (Const String)
type Node = NodeF Id
Отправлено с iPhone
Dec 12, 2010, в 20:54, Florian Weimer f...@deneb.enyo.de написал(а):
Missed.
On 30 Nov 2010, at 23:47, Ian Lynagh wrote:
A1
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
findIndexM = (liftM (findIndex id) .) . mapM
On 26 Nov 2010, at 22:46, José Romildo Malaquias wrote:
Hello.
I need a function findIndexM, similar to findIndex from the standard
module Data.List, but which works with a monadic predicate to test list
elements.
findIndex :: (a - Bool) -
family extension.
I've tried ... without success.
Thx.
On 11/22/2010 10:46 PM, Miguel Mitrofanov wrote:
Sure, it's possible with TypeFamilies. The following compiles OK:
{-# LANGUAGE TypeFamilies #-}
module TypeCalc where
data Rec a r = Rec a r
data RecNil = RecNil
data Wrapper a = Wrapper
Generally speaking, all Haskell functions are pure unless they use unsafe-
functions or FFI inside.
Отправлено с iPhone
Nov 24, 2010, в 23:46, Gregory Propf gregorypr...@yahoo.com написал(а):
I have a pretty basic question. I've been wondering about whether monadic
functions that do NOT us
Sure, you can define your own type class like that:
import Prelude hiding ((+), (-)) -- usual (+) and (-) shouldn't be here...
import qualified Prelude as P -- but they still are accessible with a prefix
class Group a where
(+) :: a - a - a
(-) :: a - a - a
instance Group Integer where
Sure, it's possible with TypeFamilies. The following compiles OK:
{-# LANGUAGE TypeFamilies #-}
module TypeCalc where
data Rec a r = Rec a r
data RecNil = RecNil
data Wrapper a = Wrapper a
class TypeList t where
type Wrapped t
i :: t - Wrapped t
instance TypeList RecNil where
type
A continuation.
You can't know, what type your fromInt n should be, but you're not going to just leave it anyway, you're gonna do some calculations with it, resulting in something of type r. So, your calculation is
gonna be of type (forall n. Nat n = n - r). So, if you imagine for a moment
11.11.2010 16:53, Stephen Tetley пишет:
On 11 November 2010 13:10, Lauri Alankol...@iki.fi wrote:
{-# LANGUAGE EmptyDataDecls, MultiParamTypeClasses, FunctionalDependencies #-}
data PetOwner
data FurnitureOwner
data Cat = Cat { catOwner :: PetOwner }
data Chair = Chair { chairOwner ::
Black letters over dark blue background hurt my eyes.
On 6 Nov 2010, at 18:10, Alistair Ward wrote:
I've just written a few packages which I think may be useful, and have made
them available as free opensource on a personal website
http://functionalley.eu.
I opted to host them there rather
Ehm... Forth? TCL?
Отправлено с iPhone
Nov 2, 2010, в 9:04, Permjacov Evgeniy permea...@gmail.com написал(а):
Let us think, that we need some scripting language for our pure haskell
project and configure-compile-run is not a way. In such a case a
reasonably simple, yet standartized and wide
On 17 Oct 2010, at 05:21, Ben Franksen wrote:
I want to prove that
f r == do
s1 - readIORef r
r' - newIORef s1
x - f r'
s3 - readIORef r'
writeIORef r s3
return x
That is not true. Consider the following function:
g r1 r2 = writeIORef r1 0 writeIORef r2 1
hdList :: List a n - Maybe a
hdList Nil = Nothing
hdList (Cons a _) = Just a
hd :: FiniteList a - Maybe a
hd (FL as) = hdList as
*Finite hd ones
this hangs, so, my guess is that ones = _|_
13.10.2010 12:13, Eugene Kirpichov пишет:
{-# LANGUAGE ExistentialQuantification, GADTs,
So... you want your ones not to typecheck? Guess that's impossible, since it's nothing
but fix application...
13.10.2010 12:33, Eugene Kirpichov пишет:
Well, it's easy to make it so that lists are either finite or bottom,
but it's not so easy to make infinite lists fail to typecheck...
That's
Отправлено с iPhone
Oct 7, 2010, в 21:03, Peter Wortmann sc...@leeds.ac.uk написал(а):
On Tue, 2010-10-05 at 17:10 -0700, Evan Laforge wrote:
+1 for something to solve the dummy - m; case dummy of problem.
Here are the possibilities I can think of:
Might be off-topic here, but I have
(g . f) x y = (\z - g (f z)) x y = g (f x) y, and you need g (f x y), which
is definitely not the same thing.
24.09.2010 13:35, Axel Benz пишет:
Hello,
this is maybe a simple question:
cbinary :: a - b - (a - b - b) - (b - c) - c
-- Version 1 works:
cbinary x y f g = g (f x y)
--
class (A x, B x, C x, D x) = U x
?
14.09.2010 12:24, Kevin Jardine пишет:
I have a set of wrapper newtypes that are always of the same format:
newtype MyType = MyType Obj deriving (A,B,C,D)
where Obj, A, B, C, and D are always the same. Only MyType varies.
A, B, C, and D are automagically
Sorry, got stupid today. Won't help.
14.09.2010 12:29, Miguel Mitrofanov пишет:
class (A x, B x, C x, D x) = U x
?
14.09.2010 12:24, Kevin Jardine пишет:
I have a set of wrapper newtypes that are always of the same format:
newtype MyType = MyType Obj deriving (A,B,C,D)
where Obj, A, B, C
On 8 Sep 2010, at 20:01, Gábor Lehel wrote:
I'm bad at expositions so I'll just lead with the code:
{-# LANGUAGE EmptyDataDecls, TypeFamilies #-}
data True :: *
data False :: *
class TypeValue a where
type ValueTypeOf a :: *
value :: ValueTypeOf a
instance TypeValue True
02.09.2010 16:49, Eoin C. Bairéad пишет:
Example 2
Prelude let fac n = if n == 0 then 1 else n * fac (n-1)
How does it know to stop ?
To stop what? It's not doing anything, it's just an equation. So fac is the least function which satisfies this equation - meaning that it's value would be
Ivan Lazar Miljenovic wrote:
I'm trying to update container-classes to duplicate the pre-existing
classes defined in the Prelude (Functor, etc.) and am trying to get my
approach on how to have functions/classes that work on types of kind *
(e.g. Bytestring) as well as kind * - * (e.g. lists),
Ivan Lazar Miljenovic wrote:
Tom Harper rtomhar...@gmail.com writes:
2010/8/17 Bulat Ziganshin bulat.zigans...@gmail.com:
Hello Tom,
snip
i don't understand what you mean. are you support all 2^20 codepoints
in Data.Text package?
Bulat,
Yes, its internal representation is UTF-16, which
On 8 Aug 2010, at 17:36, michael rice wrote:
What is - ? Couldn't find anything on Hoogle.
1) main = do
x - getLine -- get the value from the IO monad
putStrLn $ You typed: ++ x
2) pythags = do
z - [1..] --get the value from the List monad?
x - [1..z]
y
Well, Linux fanboys are known for spending too much time with their
computers compiling OS kernel or building world, no surprise their
eyes aren't in place.
On 18 Jul 2010, at 02:54, bri...@aracnet.com wrote:
On Sat, 17 Jul 2010 18:02:05 -0400
Brandon S Allbery KF8NH allb...@ece.cmu.edu
of the haskell textbooks, and if anyone knows of a good
in-depth treatment of this, I would be grateful for a pointer.
Thanks again to everyone who responded,
Simon
On Mon, Jul 5, 2010 at 2:28 PM, Miguel Mitrofanov miguelim...@yandex.ru
mailto:miguelim...@yandex.ru wrote:
My guess is that it's
My guess is that it's
class B : public A
and
class C : public A
In this case it seems perfect to use type classes:
class A t where do_x :: t - Integer - Integer - Integer
data B = ...
instance A B where do_x b x y = ...
data C = ...
instance A C where do_x c x y = ...
If you want some general
People still use Hugs? :p
Is there another option for quick prototyping on iPhone?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
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
GADTs?
data CompletePathEv p where CompletePathEv :: CompletePath p =
CompletePathEv p
class Path p = IncompletePath p where
type CompletedPath p :: *
completedPathEv :: CompletePathEv (CompletedPath p)
Later you can pattern-match on completedPathEv and get your
CompletePath
listFs = [f1, f2, f3]
map ($ x) listFs -- same as [f1 x, f2 x, f3 x]
f x y z = ...
map (\x - f x u v) xs
On 17 Jun 2010, at 23:02, Martin Drautzburg wrote:
Hello all
The standard map function applies a single function to a list of
arguments.
But what if I want to apply a list of functions
From Prelude.hs:
class (Eq a) = Ord a where
compare :: a - a - Ordering
(), (=), (), (=) :: a - a - Bool
max, min :: a - a - a
compare x y = if x == y then EQ
-- NB: must be '=' not '' to validate the
-- above claim
That won't be a great idea; if I just want my monad to be declared as one, I
would have to write
instance Functor MyMonad where fmap = ...
instance Pointed MyMonad where pure = ...
instance Applicative MyMonad where (*) = ...
instance Monad MyMonad where join = ...
Compare this with
instance
On 19 May 2010, at 08:35, Ivan Miljenovic wrote:
This looks suspiciously like homework...
2010/5/19 R J rj248...@hotmail.com:
What are some simple functions that would naturally have the
following type
signatures:
f :: (Integer - Integer) - Integer
I can only think of one solution to
(= f) is equivalent to (flip (=) f), not to ((=) f). You can try this
with your own function this way:
($^) :: (Monad m) = m a - (a - m b) - m b
($^) = undefined
:t ($^ f)
Milind Patil wrote:
For a function
f :: a - m b
f = undefined
I am having trouble understanding how the type of
(=
ErrorT :: IO (Either Error String) - ErrorT Error IO String
I can think that can be written as
ErrorT :: IO (Either Error String) - ErrorT Error (IO String)
Am I correct?
No, you're not. Similar to function application, type application is
also left-associative, so it can (but shouldn't)
It's called monad transformers
func1' :: Int - EitherT Error IO String
func1' n = EitherT $ func1 n
func2' :: Int - EitherT Error IO String
func2' s = EitherT $ func2 n
runCalc' :: Int - EitherT Error IO [String]
runCalc' param = func1' param = func2'
runCalc :: Int - IO (Either Error [String])
Well, what's the sum of an empty list? Seems naturally that it's 0, but why?
Let's say that sum [] = x.
If we take two lists, say, l1 = [1,2,3] and l2 = [4,5], then
sum l1 + sum l2 = 6 + 9 = 15 = sum [1,2,3,4,5] = sum (l1 ++ l2)
We expect it to be the case even if one of the lists is empty,
Forgot about this one:
Bjorn Buckwalter wrote:
What got me thinking about this was the apparently incorrect intuition
that 'and xs' would imply 'or xs'.
No. See, and is very close to for all, and or is similarly close to exists. For example, the statement all crows are black means just this
Doesn't seem right. IMHO, the necessity of making windows NOT fullscreen is an
indication of bad design.
Thomas Davie wrote:
On 7 Apr 2010, at 02:53, Ben Millwood wrote:
On Wed, Apr 7, 2010 at 2:22 AM, Thomas Schilling
nomin...@googlemail.com wrote:
I have
set a maximum width on purpose so
Out of curiosity: is there something wrong with my nickname migmit?
I'm not gonna change it anyway.
On 6 Apr 2010, at 09:52, Edward Z. Yang wrote:
This is a pretty terrible reason, but I'm going to throw it out there:
I like real names because they're much more aesthetically pleasing.
In
1) Haven't look closely, but your second ArrowLoop instance seems righter. The
question really is the same as with MonadFix instances; you can always define
an instance like this
data M = ... -- whatever
instance Monad M where ...
instance MonadFix M where mfix f = mfix f = f
...but this
Maybe it's just me, but I think composition chain is MUCH easier to read.
When readning, I'd probably transform the last version to the previous one by
hand, just to make it more comprehensible.
Sebastian Fischer wrote:
On Mar 10, 2010, at 8:47 AM, Ketil Malde wrote:
I think it is better
MigMit:~ MigMit$ cabal --help
This program is the command line interface to the Haskell Cabal
infrastructure.
See http://www.haskell.org/cabal/ for more information.
^
|
+
On 8 Mar 2010, at 19:51, Andrew Coppin wrote:
OK, so
Which a should it use for methods?
On 4 Mar 2010, at 09:07, muneson wrote:
When writing a command-line interface I ran into type class conflicts
I don't understand. Could anyone explain why ghc 6.10.4 compiles this
methods :: (Eq a) = [(String, a)]
methods =
[ (method1, undefined )
,
Sorry, no luck with that.
But you can, probably, define some customized comma:
data DrawPair a b = DrawPair a b
(,) :: a - b - DrawPair a b
(,) = DrawPair
instance (Drawable a, Drawable b) = Drawable (DrawPair a b) where ...
drawMany :: Drawable a = Window - a - IO ()
...
drawMany window $
I'd say we don't really need subclasses. I mean, what's the difference:
class Eq a where (==) :: a - a - Bool
instance Eq a = Eq (Maybe a) where
Nothing == Nothing = True
Just x == Just y = x == y
_ == _ = False
sort :: Eq a = [a] - [a]
or
data Eq a = Eq {eq :: a - a - Bool}
eqMaybe ::
s/subclasses/classes/
Sorry for the confusion.
Miguel Mitrofanov wrote:
I'd say we don't really need subclasses. I mean, what's the difference:
class Eq a where (==) :: a - a - Bool
instance Eq a = Eq (Maybe a) where
Nothing == Nothing = True
Just x == Just y = x == y
_ == _ = False
sort
The problem is, fromSql x doesn't know that type it should return. It's sure that it
has to be of class Convertible SqlValue, but nothing more. Could be String, or Int32,
or something else.
What if you just omit the show function? fromSql seems to be able to convert
almost anything to String.
-- {-# LANGUAGE FunctionalDependencies#-}
-- {-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
module Register where
-- class Register a r | a - r
class Register a where
type R a
-- instance Register Int Int
instance Register Int where
type R Int = Int
-- instance
For the reference: foldM is defined as
foldM :: Monad m = (a - b - m a) - a - [b] - ma
foldM _ a [] = return a
foldM f a (x:xs) = f a x = \fax - foldM f fax xs
Let's define
foldM' f x xs = lazy'foldl f (Just x) xs
We can check that foldM' satisfies the same equations as foldM:
foldM' f a [] =
With cabal-install, usually.
Limestraël wrote:
Cabal/cabal-install are good tools for distribution and installation,
but I was wondering -- as I was starting to learn how to use Cabal --
how do usually Haskell developpers build their softwares (and especially
medium or big libraries) while
Error message suggests that you've used Conf improperly.
testFunc :: (forall a. Conf a, MonadIO m = m a) - TestType
is illegal, as I recall, you should use another pair of brackets:
testFunc :: (forall a. (Conf a, MonadIO m) = m a) - TestType
Alexander Treptow wrote:
Hi,
i got a little
|multSM d m = [[(b*a)| b-[d], a-(head m)]]
Well, let's see what do we have here.
We have []'s around something. Something is [(b*a)| b-[d], a-(head m)], which is just a legal Haskell value, so our mutlSM d m has to be a one-element list, with the only element being equal to
what we put
Hom(A, B) is just a set of morphisms from A to B.
Mark Spezzano wrote:
I should probably add that I am trying various proofs that involve injective
and surjective properties of Hom Sets and Hom functions.
Does anyone know what Hom stands for?
I need a text for a newbie.
Mark
On 02/02/2010,
However, i donot know how to write pure function using C style.
func1 a = {
-- ...;
a * 2;
-- ...;
}
What do you mean by a * 2? If you don't use this value, don't
calculate it.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
iconv?
Günther Schmidt wrote:
Hi,
is there a library which converts from utf-16 to utf-8?
Günther
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Wrap it in a newtype. That's the only way I know.
Andrew U. Frank wrote:
i encounter often a problem when i have a class with some operations (say
class X with push) applied to a type A b. I then wrap A in a type A_sup, with
some more type parameters and i cannot write a instance of class
On 17 Jan 2010, at 23:22, Will Ness wrote:
What are such types called?
Dependent ones.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Works fine here (Mac OS X 10.5):
MigMit:ngram MigMit$ ghc --make Main.hs srilm.o
[1 of 2] Compiling LM ( LM.hs, LM.o )
LM.hs:9:0: Warning: possible missing in foreign import of FunPtr
[2 of 2] Compiling Main ( Main.hs, Main.o )
Linking Main ...
MigMit:ngram MigMit$ ls
On 13 Jan 2010, at 22:25, Andrew Coppin wrote:
Colin Paul Adams wrote:
Andrew It's weird that us Haskell people complain about there
Andrew being only 26 letters in the alphabet
Which alphabet?
You have plenty of choice in Unicode.
Er... I was under the impression that Haskell
Damn. Seems like I really need (True, False, True) as a result of
test.
On 7 Jan 2010, at 08:52, Miguel Mitrofanov wrote:
Seems very nice. Thanks.
On 7 Jan 2010, at 08:01, Edward Kmett wrote:
Here is a slightly nicer version using the Codensity monad of STM.
Thanks go to Andrea Vezzosi
PM, Miguel Mitrofanov miguelim...@yandex.ru
wrote:
Damn. Seems like I really need (True, False, True) as a result of
test.
On 7 Jan 2010, at 08:52, Miguel Mitrofanov wrote:
Seems very nice. Thanks.
On 7 Jan 2010, at 08:01, Edward Kmett wrote:
Here is a slightly nicer version using
. Especially as if you call it
frequently you'll be dealing with a mostly cleared nursery anyways.
-Edward Kmett
On Thu, Jan 7, 2010 at 4:39 PM, Miguel Mitrofanov miguelim...@yandex.ru
wrote:
I liked it too. Seems like I have to show some real code, and my
apologies for a long e-mail.
Well, that's
Is there any kind of ST monad that allows to know if some STRef is no longer
needed?
The problem is, I want to send some data to an external storage over a network
and get it back later, but I don't want to send unnecessary data.
I've managed to do something like that with weak pointers,
(x, y, z)
so that run test returns (True, False, True).
Dan Doel wrote:
On Wednesday 06 January 2010 8:52:10 am Miguel Mitrofanov wrote:
Is there any kind of ST monad that allows to know if some STRef is no
longer needed?
The problem is, I want to send some data to an external storage over
-Weak.html
-Edward Kmett
On Wed, Jan 6, 2010 at 9:39 AM, Miguel Mitrofanov miguelim...@yandex.ru
wrote:
I'll take a look at them.
I want something like this:
refMaybe b dflt ref = if b then readRef ref else return dflt
refIgnore ref = return blablabla
refFst ref =
do
(v, w) - readRef ref
.
This probably won't suit your needs, but it was a fun little exercise.
-Edward Kmett
On Wed, Jan 6, 2010 at 4:05 PM, Miguel Mitrofanov miguelim...@yandex.ru
wrote:
On 6 Jan 2010, at 23:21, Edward Kmett wrote:
You probably just want to hold onto weak references for your
'isStillNeeded
pbrowne wrote:
Hi,
I am studying the underlying semantics behind Haskell and to what degree
those semantics are actually implemented. I need to clarify what a *type
synonym* actual means in relation to Haskell's logic (or formal
semantics). I used the following type synonym:
type Name =
1)
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 gives you that name. It's not type
system, it's just GHCi.
Are you saying there is just one type? (not two isomorphic types because
there
Your code is equivalent to this:
adjustToBox (ObjectWrapper object) box = adjustToBox object box
but what you've probably intended to write was
adjustToBox (ObjectWrapper object) box = ObjectWrapper (adjustToBox
object box)
It has nothing to do with existentials - it's a simple type
On 18 Dec 2009, at 06:39, Richard O'Keefe wrote:
My experience has been that in order to make sense of someone else's
code you *HAVE* to break identifiers into their component words.
With names like (real example) ScatterColorPresetEditor, the eye
*can't* take it in at once, and telling the
{-# LANGUAGE GADTs, TypeFamilies #-}
module Assoc where
data EqD k where EqD :: Eq k = EqD k
class MyClass k where
data AssociatedType k :: *
evidence :: AssociatedType k - EqD (AssociatedType k)
eq :: MyClass k = AssociatedType k - AssociatedType k - Bool
-- eq k1 k2 = k1 == k2 --
:: MyClass k = k - AssociatedType k - AssociatedType k - Bool
-- eq k k1 k2 = k1 == k2 -- doesn't work
eq k k1 k2 = case evidence k of EqD - k1 == k2 -- works fine
On 17 Dec 2009, at 17:10, Miguel Mitrofanov wrote:
{-# LANGUAGE GADTs, TypeFamilies #-}
module Assoc where
data EqD k where EqD :: Eq
Not to mention that in Emacs with glasses-mode enabled camelCase can be made
even more readable (my personal favorite is highlighting internal capital
letters with bold).
Daniel Fischer wrote:
Am Mittwoch 09 Dezember 2009 23:54:22 schrieb Richard O'Keefe:
Given the amazinglyUglyAndUnreadably
I'm constantly amused by those who manage to use Windows without
installing Cygwin.
On 5 Dec 2009, at 23:33, Andrew Coppin wrote:
Stephen Tetley wrote:
Hello Andrew
Plenty compile on Windows:
Some OpenVG, OpenGL[1] (still? - I'm a bit behind the times) only
compile with MinGW.
Others are
Try Mac.
/commercial
On 6 Dec 2009, at 01:00, Andrew Coppin wrote:
Daniel Fischer wrote:
I'm constantly amazed by those who manage to use Windows.
(In case you want to misunderstand, it's not a Windows bashing, I
just never managed to work with it
I've not had a lot of luck with Linux.
Well, since he thinks we're fanatics, getting a strong emotional
reaction from us is something one certainly wouldn't desire.
On 4 Dec 2009, at 21:14, Gregory Crosswhite wrote:
Sebastian,
It helps if you think of John as having already won in this
discussion, since he succeeded in getting
Does this really mean that you want to know how the garbage collector works?
Emmanuel CHANTREAU wrote:
Hello
One thing is magic for me: how GHC can know what function results to
remember and what results can be forgotten ?
Is it just a stupid buffer algorithm or is there some mathematics
1 - 100 of 406 matches
Mail list logo