Re: [Haskell-cafe] Functional dependencies and incoherent instances

2008-10-08 Thread Joel Björnson
Hi, On Wed, Oct 8, 2008 at 2:31 PM, Tobias Bexelius <[EMAIL PROTECTED]> wrote: > Hi, > > Im trying to overload a multiplication operator for scalars and vectors, > but keep running into the error message "Functional dependencies > conflict". What I think is going on is that the dependency check do

Re: [Haskell-cafe] generating javascript

2006-11-30 Thread Joel Björnson
2006/11/30, jeff p <[EMAIL PROTECTED]>: Is the JavaScript embedding in HSPClientside essentially the same as the embedding explained in Broberg's thesis? Yes, in principal the core modules are based on the thesis. Combinators and higher level functions are built on top of these. /Joel __

Re: [Haskell-cafe] generating javascript

2006-11-29 Thread Joel Björnson
2006/11/29, jeff p <[EMAIL PROTECTED]>: This seems to contain just what I was looking for. Although I'm not using HSP, it looks like the HSPClientside library can be used (in conjunction with Text.XHtml) to generate webpages with embedded scripts. It sure should be possible to use HSPClientsi

Re: [Haskell-cafe] Nested Monads Questions

2006-08-11 Thread Joel Björnson
2006/8/11, Stefan Aeschbacher <[EMAIL PROTECTED]>: HiI'm trying to understand Monad Transformers. The code below works asexpected but I have the following questions: - why can I use liftIO but not lift in the doSomething function?I will first try to explain why it is not possible to use lift. Shor

[Haskell-cafe] Re: [Haskell] AJAX applications in Haskell

2006-08-09 Thread Joel Björnson
2006/8/9, Pasqualino 'Titto' Assini <[EMAIL PROTECTED]>: Hi,Those among you who have an interest in AJAX-style web development - that isto say the development of web applications that run entirely into thebrowser environment, calling back to the server back-end only to get raw data -- will probably

[Haskell-cafe] Re: Type inference problem

2006-08-07 Thread Joel Björnson
2006/8/6, Joel Björnson <[EMAIL PROTECTED]>: So far, so good... However, problems arises trying to define the function : test = toElem myElemYielding the error message : 'No instance for (Show Elem) arising use of `toElem` at ...' For some reason it seems like the type checker

[Haskell-cafe] Type inference problem

2006-08-06 Thread Joel Björnson
Hi. I have a type inference related problem which causes me some confusion. The following is a simplified example capturing the key aspects. First of all, consider a data type (here called) Elem and a type class IsElem. data Elem = Eclass IsElem a where  toElem :: a -> Eleminstance IsElem Elem whe

[Haskell-cafe] Deducing Show for GADTs

2006-06-28 Thread Joel Björnson
Hi. I came a cross the following phenomena which, at least to me, occurs kind of awkward. The code below : data MyData a  where   DC1 :: (Show a ) => a -> MyData a   instance Show (MyData a) where   show (DC1 a ) = show a yields the ghci error :   'Could not deduce (Show a) from the context (Sho

Re: [Haskell-cafe] FunDeps conflict

2006-06-06 Thread Joel Björnson
Brian Hulley wrote : > Possibly you meant to write: >  instance IsFoo a => Class2 a a >  instance Class2 (Bar a) a Yes, in principle that illustrates the idea. However I don't see the major difference from constraining the 'a' to the IsFoo class, as in   instance IsFoo a => Class2 (Bar a) a This

[Haskell-cafe] FunDeps conflict

2006-06-06 Thread Joel Björnson
Hi. I have a question regarding type classes and FunDeps. Consider the following code : > class Class2 a b | a -> b > class IsFoo a > data Bar a = Bar a > instance IsFoo a => Class2 a a > instance IsFoo a => Class2 (Bar a) a The last two instantiations will yield a 'Functional dependencies conf