Dear Haskellers,
When programming with type functions, I often find myself with a set of
invariants that are frequent in my programs and can be expressed as equality
constraints on the context of the functions.
I wonder if there is any way in current GHC to express some kind of synonyms
for
Thank you for the info., I didn't know that it had already been proposed.
The constraint families seem definitely useful.
hugo
On Thu, Nov 25, 2010 at 12:53 PM, Sebastian Fischer fisc...@nii.ac.jpwrote:
On Thu, 2010-11-25 at 10:41 +0900, Hugo Pacheco wrote:
Would this be a desired feature
There is a page for extensible records in the wiki:
http://www.haskell.org/haskellwiki/Extensible_record
Haskell's records system has many insuficiencies.
Some libraries (see grapefruit or HaskellDB) encode records as
classes, but although some proposals Haskell still lacks a good
implementation
I have previously thought of something like this, when the initial
idea for a sloth was suggested:
I like the ideia, and could imagine something like this:
http://i41.tinypic.com/se65ux.jpg
Sorry for the bad drawing and scanning quality. If someone likes the ideia,
I'm sure
they can do
Hi all,
Under gitit 0.5.3 I always get Prelude.read: no parse when trying to
load a configuration file.
My previous file goes attached, but the sample config file from
http://github.com/jgm/gitit/tree/master does not work also.
Has anything changed that is not documented?
Thanks,
hugo
On Sun,
Hi all,
Under gitit 0.5.3 I always get Prelude.read: no parse when trying to
load a configuration file.
My previous file goes attached, but the sample config file from
http://github.com/jgm/gitit/tree/master does not work also.
Has anything changed that is not documented?
Thanks,
hugo
On Sun,
Still nothing. No matter which config file I try (deleting almost
every fields, newlines, etc), I always get the no parse error.
On Thu, Feb 26, 2009 at 5:47 AM, Robin Green gree...@greenrd.org wrote:
On Thu, 26 Feb 2009 14:30:17 +
Hugo Pacheco hpach...@gmail.com wrote:
Hi all,
Under
made this file on OSX and forgot to invoke the Format Make Plain
Text command, it'll be an RTF file which I'm sure gitit will have no clue
about.
-Ross
On Feb 26, 2009, at 10:21 AM, Hugo Pacheco wrote:
Still nothing. No matter which config file I try (deleting almost
every fields
I noticed that you convert point-wise into point-free.Perhaps you could add
some point-free transformations to remove redundancy in certain cases.
Is that a goal of the library?
Cheers,
hugo
On Sat, Dec 20, 2008 at 9:55 AM, Neil Mitchell ndmitch...@gmail.com wrote:
Hi,
I am pleased to
((:*:))
type instance Rep Id x =
x
Cheers,
hugo
On Sat, Dec 20, 2008 at 10:21 AM, Hugo Pacheco hpach...@gmail.com wrote:
I noticed that you convert point-wise into point-free.Perhaps you could
add some point-free transformations to remove redundancy in certain cases
On Sat, Dec 20, 2008 at 3:06 PM, Neil Mitchell ndmitch...@gmail.com wrote:
Hi
I noticed that you convert point-wise into point-free.
Perhaps you could add some point-free transformations to remove
redundancy
in certain cases.
Is that a goal of the library?
It does some
I like the ideia, and could imagine something like this:
http://i41.tinypic.com/se65ux.jpg
Sorry for the bad drawing and scanning quality. If someone likes the ideia,
I'm sure they can do much better than me :)
hugo
On Fri, Dec 19, 2008 at 12:53 PM, Tobias Kräntzer
i...@tobias-kraentzer.dewrote:
I just found this on the web.
Do you like the description of Haskell? It is not that far from true :P
http://www.aegisub.net/2008/12/if-programming-languages-were-religions.html
--
www.di.uminho.pt/~hpacheco
___
Haskell-Cafe mailing list
Dear Haskelleers,
Alcino Cunha and me are pleased to announce the release of the DrHylo tool
in Hackage:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/DrHylo
DrHylo is a tool for deriving hylomorphisms from a restricted Haskell
syntax. It is based on the algorithm first presented in
Dear Haskelleers,
Alcino Cunha and me are pleased to announce the release of the Pointless
Haskell library in Hackage:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/pointless-haskell
Pointless Haskell is library for point-free programming with recursion
patterns defined as
. observe List Int .concat) [[1,2],[3,4]]
I suggest you install the cabal package and try the sample module form the
Hood homepage:
http://www.haskell.org/hood/downloads/Main.hs
Feel free to ask for anything.
Cheers,
hugo
On Sat, Dec 6, 2008 at 9:59 PM, Simon Michael [EMAIL PROTECTED] wrote:
Hugo
On Sat, Dec 6, 2008 at 11:13 PM, Simon Michael [EMAIL PROTECTED] wrote:
Hugo,
I thought this Hood stuff is so old, there's no point checking hackage.
Silly me! I did cabal update; cabal install GHood on this mac and tried your
example:
As an example, just import Debug.Observe (the GHood
the intermediate types of haskell functions.
GHood has had many contributors throughout the years:
Hugo Pacheco, packaging
Alcino Cunha, ObserveM monad
Claus Reinke, the creator or GHood
Andy Gill, the creator of Hood
Please forward any feedback to myself.
Cheers,
hugo
--
www.di.uminho.pt
Pointless Haskell a library for point-free programming with recursion
patterns that uses type synonym families to provide a view of data types as
the fixed points of functors.
It defines two type functions
type family PF a :: * - * -- returns the pattern functor for a
data type
type
changes from 0.9.2 to 0.9.3, so I thought
it best not to allow 0.9.2.x, even though it still compiles with a
warning.)
+++ Hugo Pacheco [Nov 09 08 20:41 ]:
a new HAppS version [1]0.9.3.1 has been released, and gitit requires
HApps==[2]0.9.2.1. should ti be ok just to relax the dependency
yes, I am talking about inserting HTML inside the wiki.Thanks, I will check
on that and report back,
hugo
On Wed, Dec 3, 2008 at 3:44 PM, John MacFarlane [EMAIL PROTECTED] wrote:
+++ Hugo Pacheco [Dec 03 08 09:36 ]:
Good morning,
I wonder if it is possible to embed regular HTML code
to be a permissions problem, I gave full permissions to all
gitit files and nothing changed.
Any idea why?
Also being an headache is configuring apache reverse proxy for it:
http://haskell.di.uminho.pt/wiki/
hugo
On Wed, Dec 3, 2008 at 6:03 PM, Hugo Pacheco [EMAIL PROTECTED] wrote:
yes, I am talking about
Solved, just something with my Safari cookies, sorry.
On Wed, Dec 3, 2008 at 8:40 PM, Hugo Pacheco [EMAIL PROTECTED] wrote:
On a different level, I was trying the wiki on my laptop, but have now
installed it in a remote server.
However, with the same configurations, I can create users
think this is some kind of bug with the session state.
Regards,
hugo
On Wed, Dec 3, 2008 at 9:29 PM, Hugo Pacheco [EMAIL PROTECTED] wrote:
Solved, just something with my Safari cookies, sorry.
On Wed, Dec 3, 2008 at 8:40 PM, Hugo Pacheco [EMAIL PROTECTED] wrote:
On a different level, I
I think that Anatoly was suggestion a bridge between markdown and haddock
syntax.
Of course gitit would read haddock-documented sources and generate different
results than haddock itself (showing highlighted source code is the most
significant).
Being practical, this is very close to the
Since System Fc is implemented in the latest releases of GHC, is it
implemented in Haskell so that I can play with the translator? Can I find it
in the ghc sources?
Thanks,
hugo
--
www.di.uminho.pt/~hpacheco
___
Haskell-Cafe mailing list
Hi,
When migrating some code with type families to GHC 6.10, I frequently get
the same error.
The deal is. If I define some type family and instance:
*type family Rep (f :: * - *) x :: *
data (g :+: h) x= Inl (g x) | Inr (h x)
type instance Rep (g :+: h) x = Rep g x `Either` Rep h x*
and
Hi,
When previewing some package via the Hackage web interface, I get the
following warning:
Exposed modules use unallocated top-level names: AI assume that if you
define some module A.B, it expects the top-level name A to be a module.
Does this make sense?
Thanks,
hugo
--
When installing package haskell-src-exts via cabal install, I get the error
Language/Haskell/Exts/Syntax.hs:102:7:
Could not find module `Data.Data':
it is a member of package base, which is hidden
However, when manually installing
runhaskell Setup.hs configure/build/install
It works
Yes, I installed it via cabal-install.I am using GHC 6.10.1 now, but it had
the same results in 6.6 (if I remember well) before. It may be a Mac issue.
On Mon, Nov 10, 2008 at 1:39 PM, Korcan Hussein [EMAIL PROTECTED]wrote:
Sorry I have no idea, which version of GHC are you using? did you
I read on your youtube post that you are planning to write a
build-it-yourself tutorial.Perhaps this effort could be targeted at creating
a cabal package in Hackage (I do not know the implications of that, just
speaking out loud).
Cheers,
hugo
2008/11/10 Korcan Hussein [EMAIL PROTECTED]
I
it is however. the same happened to me.you just need to run
cabal install pcre-light --extra-include-dirs=/opt/local/include
--extra-lib-dirs=/opt/local/lib
My location is /opt/local, since I installed pcre via macports
sudo port install pcre
Bue I think pcre is installed by default in
Hi all,
The HappS version on Hackage does not yet support ghc 6.10, since GADT
pattern matching and the Exception API have changed.
One sample error is:
src/HAppS/Data/Xml/Base.hs:281:23:
GADT pattern match with non-rigid result type `t1'
Solution: add a type signature
...
Adding a
yes, 0.9.3 is out and it has compiled ok.thanks :)
hugo
On Sun, Nov 9, 2008 at 7:58 PM, Don Stewart [EMAIL PROTECTED] wrote:
hpacheco:
Hi all,
The HappS version on Hackage does not yet support ghc 6.10, since GADT
pattern matching and the Exception API have changed.
One
a new HAppS version 0.9.3.1 has been released, and gitit requires HApps==
0.9.2.1. should ti be ok just to relax the dependency?
On Sat, Nov 8, 2008 at 8:32 PM, John MacFarlane [EMAIL PROTECTED] wrote:
I've uploaded an early version of gitit, a Haskell wiki program, to
HackageDB. Gitit uses
Hi all,
I have been searching for examples of Haskell real scenarios that employ
mutually recursive datatype definitions.
Does anyone know some interesting libraries or structures that I could play
with?
Thanks,
hugo
--
www.di.uminho.pt/~hpacheco
___
Probably I overdid the real part.I was thinking of examples such as ASTs
(such as the Haskell one), trees and imagining more fancy things, maybe
L-systems and fractal processing.
I will have a look at the Haskell sources and the previous papers from Tim
Sheard.
Cheers,
hugo
On Sun, Oct 26, 2008
I remember that HaXML has also a lazy XML parser. maybe if you just need to
use some specific information stored in your XML file you can earn some
time/memory with it.From my experience, HXT seems faster.
Cheers,
hugo
2008/10/23 Krasimir Angelov [EMAIL PROTECTED]
Hi,
Does some one have made
It was down for me as well, right after Neil's message and it has happened
before as well.I wonder why the interruptions.
hugo
On Mon, Sep 29, 2008 at 4:34 PM, Achim Schneider [EMAIL PROTECTED] wrote:
Dougal Stanton [EMAIL PROTECTED] wrote:
(Seriously though, the above site is a great tool
Hi all,
There is something about polymorphic tests in QuickCheck that I do not
understand.
If you write the simplest dummy test function
tst :: a - Bool
tst _ = True
and evaluate it we get
verboseCheck tst
0:
()
1:
()
...
How come did the polymorphic value a get instanciated to ()? Is this
instantiated to ().
Thanks,
hugo
On Tue, Jun 17, 2008 at 11:05 AM, Dougal Stanton [EMAIL PROTECTED]
wrote:
2008/6/17 Hugo Pacheco [EMAIL PROTECTED]:
Hi all,
There is something about polymorphic tests in QuickCheck that I do not
understand.
If you write the simplest dummy test function
, 2008 at 12:17 PM, Sebastiaan Visser [EMAIL PROTECTED]
wrote:
On Jun 17, 2008, at 11:53 AM, Hugo Pacheco wrote:
Hi all,
There is something about polymorphic tests in QuickCheck that I do not
understand.
If you write the simplest dummy test function
tst :: a - Bool
tst _ = True
se bem me lembro o 2lt já está neste report, que tal acrescentar uma
referência a isto das type families ou n vale a pena?
On Thu, Apr 24, 2008 at 3:01 PM, Janis Voigtlaender
[EMAIL PROTECTED] wrote:
Dear Haskellers,
so much has happened in the Haskell world in the past months.
Therefore,
se bem me lembro o 2lt já está neste report, que tal acrescentar uma
referência a isto das type families ou n vale a pena?
On Thu, Apr 24, 2008 at 3:01 PM, Janis Voigtlaender
[EMAIL PROTECTED] wrote:
Dear Haskellers,
so much has happened in the Haskell world in the past months.
Therefore,
Hi guys,
I have been experimenting some weird stuff (risky, yes I know) but the
behaviour was certainly not the one I expected:
{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}
module Nest where
data Nest a = Nil | Cons a (Nest (a,a))
type family F a x :: *
type instance F (Nest a)
,
hugo
On Mon, Apr 7, 2008 at 10:30 PM, Hugo Pacheco [EMAIL PROTECTED] wrote:
Hi guys,
I have been experimenting some weird stuff (risky, yes I know) but the
behaviour was certainly not the one I expected:
{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}
module Nest where
data
On Sun, Mar 30, 2008 at 3:54 AM, Manuel M T Chakravarty
[EMAIL PROTECTED] wrote:
Hugo Pacheco:
Yes, but doesn't the confluence problem only occur for type synonyms
that ignore one or more of the parameters? If so, this could be
checked...
You can't check this easily (for the general
synonyms in type families, otherwise
code starts to get dummier in terms of type contexts and context variables.
Thanks,
hugo
On Sun, Mar 30, 2008 at 4:14 AM, Hugo Pacheco [EMAIL PROTECTED] wrote:
On Sun, Mar 30, 2008 at 3:54 AM, Manuel M T Chakravarty
[EMAIL PROTECTED] wrote:
Hugo Pacheco
The current implementation is wrong, as it permits
type S a b = a
type family F a :: * - *
type instance F a = S a
Why do we need to forbid this type instance? Because it breaks the
confluence of equality constraint normalisation. Here are two
diverging normalisations:
(1)
Sorry, I meant
type FList a x = Either One (a,x)
type instance F [a] = FList a
On Thu, Mar 27, 2008 at 4:45 PM, Hugo Pacheco [EMAIL PROTECTED] wrote:
The current implementation is wrong, as it permits
type S a b = a
type family F a :: * - *
type instance F a = S a
Why do
2008 22:43 schrieb Wolfgang Jeltsch:
Am Mittwoch, 26. März 2008 03:07 schrieb Hugo Pacheco:
The extra syntax has its advantages (more local information) and
disadvantages (more clutter). We weren't convinced that we need the
extra syntax, so left it out for the moment. However
Yes, but doesn't the confluence problem only occur for type synonyms that
ignore one or more of the parameters? If so, this could be checked...
On Fri, Mar 28, 2008 at 12:04 AM, Manuel M T Chakravarty
[EMAIL PROTECTED] wrote:
Hugo Pacheco:
Sorry, I meant
type FList a x = Either One (a,x
Hi guys,
There is something I think not to fully understand: what are the differences
between these two type synonyms?
type FInt x = Either One x
type FInt = Either One
Their kind is the same, so do they differ or are exactly the same type?
Thanks,
hugo
The extra syntax has its advantages (more local information) and
disadvantages (more clutter). We weren't convinced that we need the
extra syntax, so left it out for the moment. However, this is
something that can always be changed if experience shows that programs
are easier to understand
Hi,
I am trying to understand some differences of parameterizing or not some
arguments of type families.
I have some code such as
*type family G a :: * - *
instance Functor (G Int) where
fmap f (Left ()) = Left ()
fmap f (Right x) = Right (f x)
ggg :: Functor (G a) = G a x - G a x
ggg =
I wonder if I am dealing with bugs in the type checker (replying to myself).
Curiously if I have
class FunctorF d where
fmapF :: d - (x - y) - F d x - F d y
fff a = fmapF a id
it compiles correctly. If I infer the type signature of fff I get
fff :: forall d x. (FunctorF d) = d - F d x - F
] wrote:
On 3/17/08, Hugo Pacheco [EMAIL PROTECTED] wrote:
type family G a :: * - *
type instance G Int = Either () -- you forgot this line
instance Functor (G Int) where
fmap f (Left ()) = Left ()
fmap f (Right x) = Right (f x)
One thing that you don't seem to be clear about
Submited: http://hackage.haskell.org/trac/ghc/ticket/2151#preview
hugo
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
That's simple Tom.
Imagine the factorial function for Int written as a paramorphism:
type instance F Int = Either One
instance (Mu Int) where
inn (Left _) = 0
inn (Right n) = succ n
out 0 = Left ()
out n = Right (pred n)
instance Functor (F Int) where
fmap _ (Left ()) = Left
Hi guys,
I have found a bug on the compiler (at least ghc 6.8.2). For some module
(yes, the example does nothing at all):
*module Test where
data Type a where
Func :: Type a - Type b - Type (a - b)
PF :: Type a - Type (PF a)
data PF a where
ID :: PF (a - a)
test :: Type a - a - a
Hi have tried with all versions until ghci-6.9.20080303 (from the nightly
builds), is that the one?
I'm sorry but where in the darcs repo can I find it? I cannot find a
ghc-6.9branch.
Thanks,
hugo
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
I know I do not need these constraints, it was just the simplest way I found
to explain the problem.
I have fought about that: I was not expecting F d c ~ F a (c,a) not mean
that F d ~F a /\ c ~(c,a), I thought the whole family was parameterized.
If I encoded the family
type family F a x :: *
Yes, I have tried both implementations at the start and solved it by
choosing for the following:
type family F a :: * - *
type FList a x = Either () (a,x)
type instance F [a] = FList a
instance (Functor (F [a])) where
fmap _ (Left _) = Left ()
fmap f (Right (a,x)) = Right (a,f x)
The option was:
Hi all,
I have encoded a type family such that:
type family F a :: * - *
and a function (I know it is complicated, but I think the problem is self
explanatory):
hyloPara :: (Functor (F a), Functor (F d), F d a ~ F a (a,a), F d c ~ F a
(c,a)) = d - (F d c - c) - (a - F d a) - a - c
hyloPara d g
I don't know if this is exactly what you were expecting as a dummy argument,
but I solve this kind of issues like this:
_L = undefined
class C a where
type TT a
val :: a - TT a
instance C () where
type TT () = ()
val _ = ()
instance (C a, C b) = C (a, b) where
type TT (a,b)
If the equality does not hold, you should get a type error because
your program is not type correct. So, what is it that you would like
different?
I would simply like the compiler not to use that instance if the equality
constraint does not hold, like some another instance dependency
What I said is not true since overlapping instances are not that much
decidable.
Btw, in previous versions of GHC this worked well, but now I suppose order
does not suffices to define instances overlapping
How could I compile such an example, assuming that I want to use the
instance C String for
Just something I have been wondering.
I would like to implement somehting like:
type family F a :: * - *
...
class C a b where ...
instance (F a ~ F b) = C a b where ...
But apparently type equality coercions can not be used as a single context.
If I enable -fallow-undecidable-instances,
Hi all,
I have recently tried to replicate some examples from in the articles about
type families but found some possible bugs.
In [2], the example
class C a where
type S a (k :: * - *) :: *
instance C [a] where
type S [a] k = (a,k a)
does not compile under the claim that the type
The binaries do work in Leopard, but it misses all library files, such as
System.IO.
How can I build them form the sources? I have no cabal-install as well. and
the macports 6.6 is broken.
___
Haskell mailing list
Haskell@haskell.org
From the ghc-6.8.2 sources then, I'm just afraid of possible errors, and I
don't have any previous ghc installed.
Do the sources permit bootstrapping? From what I know...
*The source distribution needs an installed GHC (version 6.0 at least). If
your platform isn't currently supported with a
But is it like days, weeks, months?
I really need GHC installed on my intel mac w/ leopard.
How can I build the libraries in the current leopard release?
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell
Hmm, basically, the build from the GHC site ssimply installs the
executables, every libary file is missing somehow (all the base package..
etc)
Therefore I have two options to have a working 6.8.x installation:
- wait around a week for a new macport (preferable)
- try to install the missing
The sel function was just the simpliest example I remembered of.
Yes, I would need to generate code at runtime according since the generated
code would depend on the function arguments, but have already guessed It
wouldn't be possible.
Anyway, thanks for the clarification,
hugo
hs-plugins does look promising.
thanks for the hint,
hugo
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hi all,
I'm try to write some function in TH that I don't even know if it is
possible.
Consider the example from the tutorials
sel 1 2 = [| \(x,_) - x |]
sel 2 2 = [| \(_,x) - x |]
If I want to write some function that will dynamically create a selection
function according to its arguments
I'm forwarding this mail, in case anyone might know about the bug.
-- Forwarded message --
From: Hugo Pacheco [EMAIL PROTECTED]
Date: Jul 18, 2007 3:45 AM
Subject: Happy Error
To: [EMAIL PROTECTED]
Hi Simon,
I'm having what I supose ti be a oarsec internal error when trying
I'm sorry, it turned out to be pretty simples.
The error appears when there are references to undefined terminal or
non-terminal productions.
That's it.
Sorry for the messages, at least it might be of some help to someone else.
hugo
On 7/18/07, Hugo Pacheco [EMAIL PROTECTED] wrote:
Hi Simon
Hi,
I have a set of functor definitions with corresponding instances
newtype Id a = Ident {unIdent :: a} deriving Eq
newtype K b a = Const {unConst :: b} deriving Eq
instance Functor Id where
fmap f (Ident x) = Ident $ f x
instance Functor (K a) where
fmap f (Const x) = Const x
That doesn't help in any sense, my problem is that I need to use the class
method, but I take the context from granted, but the compiler still needs a
general instance for any functor f.
hugo
___
Haskell mailing list
Haskell@haskell.org
Hi, I have resumed my problem to the following.
In this small example, the type checker always complains, and do need to
write something similar that would use the functional dependency to infere
the type b.
class SomeClass a b | a - b
instance SomeClass Int Bool
test :: SomeClass a b = a - b
On 6/16/07, David House [EMAIL PROTECTED] wrote:
Hugo Pacheco writes:
test :: SomeClass a b = a - b
test 1 = True
test, as you've written it, is only a function from Ints to Bools, not
from any
a to any b where SomeClass a b holds. It is true that SomeClass Int Bool
is the
only instance
Hi,
I have defined some functors (with respective Functor instances) and a
class that derives the equivalent non-functor representation
class (Functor f) = Rep f a b | f a - b
My problem is that I need to define another class
class (Functor f,Rep f d c) = FunctorOf f d | d - f where
in''
83 matches
Mail list logo