I have a yesod project, which generated, say, UserPassword in module Model.
Then I wrote my template code which generate a piece of code to use
UserPassword. I imported Model in my code.
Then I got
Illegal variable name: `UserPassword'
When splicing a TH declaration:
--
竹密岂妨流水过
山高哪阻野云飞
And
Yes, I misunderstood the generated code and splice shown in error message.
Thanks.
On Wed, Jul 3, 2013 at 11:04 PM, adam vogt vogt.a...@gmail.com wrote:
On Wed, Jul 3, 2013 at 2:25 AM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Then I got
Illegal variable name
to be the wrong type.
21.06.2013, 12:18, Magicloud Magiclouds magicloud.magiclo...@gmail.com
:
data ActionData = AD { oldData :: (FromJSON j, ToJSON j) = j
, newData :: (FromJSON j, ToJSON j) = j}
instance ToJSON ActionData where
toJSON (AD o n) = object [ oldData .= o
data ActionData = AD { oldData :: (FromJSON j, ToJSON j) = j
, newData :: (FromJSON j, ToJSON j) = j}
instance ToJSON ActionData where
toJSON (AD o n) = object [ oldData .= o
, newData .= n ]
instance FromJSON ActionData where
parseJSON
/20130313-1/conduit/src/Data-Conduit-Binary.html#lines
On Mon, Apr 8, 2013 at 8:44 AM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Say I have code like below. If I comment the leftover in main, I got
(Just L1\n, Just L2\n, Just L3\n, Just L4\n). But if I did not
comment
Say I have code like below. If I comment the leftover in main, I got (Just
L1\n, Just L2\n, Just L3\n, Just L4\n). But if I did not comment
the leftover, then I got (Just L1\n, Just L1\n, Just , Just L2\n).
Why is not it (Just L1\n, Just L1\n, Just L2\n, Just L3\n)?
takeLine :: (Monad m) =
Hi,
I have a yesod project that used to be compilable. Now when I migrate it
to latest yesod, it failed compiling.
-- Forwarded message --
From: Magicloud Magiclouds magicloud.magiclo...@gmail.com
Date: Tue, Apr 2, 2013 at 9:32 PM
Subject: Re: [Yesod] Type issue in new yesod
Never noticed copy command. Let me see
On Wed, Jan 16, 2013 at 1:51 PM, Albert Y. C. Lai tre...@vex.net wrote:
On 13-01-15 09:10 PM, Magicloud Magiclouds wrote:
So the only way is to use param every time I build this certain project?
Really hoping I could disable it in project.cabal
-library-profiling --disable-executable-profiling'
The alias 'ciq' stands for 'cabal install quick' and disables things I
don't need during development, but do slow down the build.
Regards,
Erik
On Wed, Jan 16, 2013 at 3:10 AM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
So
So the only way is to use param every time I build this certain project?
Really hoping I could disable it in project.cabal
On Wed, Jan 16, 2013 at 6:45 AM, Albert Y. C. Lai tre...@vex.net wrote:
On 13-01-15 12:06 AM, Magicloud Magiclouds wrote:
I have enabled document in .cabal
12:06 AM, Magicloud Magiclouds wrote:
I have enabled document in .cabal/config, so I could get document
every time I installed libraries or so.
But when I compile my own applications, it also takes time on
generating non-exist documents. How to disable it just for this
project
You guys are great! Thanks.
On Wed, Dec 26, 2012 at 9:04 AM, Timon Gehr timon.g...@gmx.ch wrote:
On 12/25/2012 09:59 AM, Magicloud Magiclouds wrote:
Say I have things like:
data LongDec = LongDef a b c ... x y z
values = [ 'a', 'b', 'c', ... 'x', 'y', 'z' ]
Now I want them to be LongDef
I see. A known bug. Thank you all.
On Tue, Dec 18, 2012 at 10:11 PM, Rico Moorman rico.moor...@gmail.comwrote:
regex = table\\s+class=\sourceCode[^]+.*?/table-
And mind the sneaky single - ... it doe not belong there ;-)
--
竹密岂妨流水过
山高哪阻野云飞
And for G+, please use
Thank you two. I have got it working. Compared to ri, I think:
The pro is I could find the package that I want even I do not know it.
The con is I'd have to manually update its data.
On Mon, Nov 26, 2012 at 9:21 AM, John Wiegley jo...@fpcomplete.com wrote:
Tikhon Jelvis tik...@jelv.is writes:
RI is a very easy using tool that search and show the documents of ruby
modules/functions, etc.
Using RI, I could get help when programming with a few commands. Quick and
simple.
And with RI backend (libs), I could also simply integrate ri to my IDE
(like one hotkey to show function summary).
So
, Magicloud Magiclouds
magicloud.magiclouds@gmail.**com magicloud.magiclo...@gmail.com
wrote:
command line: cannot satisfy -package Cabal-1.16.0:
Cabal-1.16.0-**dd0ce1db6fea670a788547ee854114**86 is unusable due
to missing
or recursive dependencies:
directory-1.2.0.0
Sorry, I left the profiling option on, which seems to suppress the
dynamic options.
On Mon, Oct 29, 2012 at 1:29 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hi,
I set shared: True in ~/.cabal/config, and using ghc 7.6.1. Then
clear user space hackages and reinstall them
Seems like an issue with fedora17's ld. I altered it with ld.gold. Working.
On Tue, Oct 9, 2012 at 7:33 AM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Could anyone help me on this?
On Sun, Oct 7, 2012 at 10:34 AM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote
Could anyone help me on this?
On Sun, Oct 7, 2012 at 10:34 AM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
There is none
On Sun, Oct 7, 2012 at 4:27 AM, Thomas Schilling
nomin...@googlemail.com wrote:
Does `ghc-pkg check` report any issues?
On 6 October 2012 15:24
There is none
On Sun, Oct 7, 2012 at 4:27 AM, Thomas Schilling
nomin...@googlemail.com wrote:
Does `ghc-pkg check` report any issues?
On 6 October 2012 15:24, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hi,
I am installing postgres hackage (cannot remember the exact
Thank you. Will do.
On Mon, Sep 17, 2012 at 7:14 AM, Antoine Latter aslat...@gmail.com wrote:
On Sun, Sep 16, 2012 at 5:04 PM, Richard O'Keefe o...@cs.otago.ac.nz wrote:
On 15/09/2012, at 5:14 AM, Chris Heller wrote:
You might want to have a look at the time-recurrence package:
) t | n - [0..]]
(you need fromIntegral for seconds, because it is of fractional type in
Data.Time).
iterate style, as suggested by Karl:
iterate (seconds ^+= 1) t
iterate (minutes ^+= 1) t
On Fri, Sep 14, 2012 at 7:29 AM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hi
Hi,
Simple usage, I could make an instance of Enum to UTCTime, so
[utcTime..] could work. But that is so stiff. How if sometimes I want
to step by 1 min, sometimes I want to step by 1 sec?
So I think some way like [ t | addUTCTime last 60 ] could be nice.
But I cannot figure it out
Any
Hi,
I have code like this and it leaves lots of zombies of flow-export.
Then I add waitForProcess Well I do not know where to put it.
Before or after 'hGetContents' both make the program hung.
exportCSV :: FilePath - IO [String]
exportCSV file = do
csv_ - withBinaryFile file ReadMode $ \i
Forgot about that, just read 'readProcess' code to figure out.
Thanks.
On Wed, Sep 5, 2012 at 12:37 PM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
On 5 September 2012 13:45, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hi,
I have code like this and it leaves lots
Hi,
Since Maybe is a monad, I could write code like 'maybeA maybeB
maybeC' to check if all these are not Nothing. Or 'liftM foo maybeD'
to avoid ugly 'case of'.
But how if here maybe[ABC] are like 'IO (Maybe Int)', or foo is type
of 'Int - IO Int'?
--
竹密岂妨流水过
山高哪阻野云飞
And for G+, please use
Hi,
Say I have a package that only appends
--constraint=template-haskell==2.7.0.0
--constraint=warp-tls==1.2.1 could I install it. Now I want to
release the package, then how could I have these constraint into the
.cabal so the user would not get troubled?
--
竹密岂妨流水过
山高哪阻野云飞
And for G+, please
Have found the place in openldap where the error occurs, but do not know why.
Please refer to http://hackage.haskell.org/trac/ghc/ticket/6128 .
On Thu, Jul 12, 2012 at 2:03 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
I made a little code, to explicitly use unbind:
ldapWith
Sorry for that. The problem got solved yesterday.
On Mon, Jul 16, 2012 at 6:01 PM, Lars Viklund z...@acc.umu.se wrote:
On Thu, Jul 12, 2012 at 09:41:43AM +0800, Magicloud Magiclouds wrote:
Sorry for the attachments. They are wireshark files.
May I suggest not sending multi-megabyte files
(or cabal?) required
package-version:function.
But --constraint='template-haskell-2.7.0.0' did make it compiled.
On Wed, Jul 11, 2012 at 1:34 PM, Claude Heiland-Allen
cla...@mathr.co.uk wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi,
On 11/07/12 05:51, Magicloud Magiclouds wrote:
I
But why it does not occur on other installation?
And Albert, I did not directly install QuickCheck. It was required by yesod.
On Wed, Jul 11, 2012 at 10:55 PM, Brandon Allbery allber...@gmail.com wrote:
On Wed, Jul 11, 2012 at 5:28 AM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote
on
On Fri, Jun 1, 2012 at 5:17 PM, Chris Dornan ch...@chrisdornan.com wrote:
No problem -- I have attached the executable too.
Chris
-Original Message-
From: Magicloud Magiclouds [mailto:magicloud.magiclo...@gmail.com]
Sent: 01 June 2012 02:01
To: Chris Dornan
Subject: Re: [Haskell
Dug a little more. Seems that ghc 7.4.* finalizes (ldap_unbind action)
the ldap ptr before the references were actually dropped.
On Thu, Jul 12, 2012 at 9:41 AM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Sorry for the attachments. They are wireshark files.
On Thu, Jul 12, 2012
I cleaned out everything, no luck
On Fri, Jul 6, 2012 at 2:14 AM, Albert Y. C. Lai tre...@vex.net wrote:
On 12-07-03 04:19 AM, Magicloud Magiclouds wrote:
$ cabal --upgrade-dependencies --enable-documentation
--force-reinstalls --solver=topdown QuickCheck-2.5
Test/QuickCheck/All.hs:15:1
Hi,
This had never happened to me. And I have no idea what to do.
$ cabal --upgrade-dependencies --enable-documentation
--force-reinstalls --solver=topdown QuickCheck-2.5
Test/QuickCheck/All.hs:15:1:
Bad interface file:
Here is the code, I joined two modules in one paste. Both of them
cannot pass compiling.
http://hpaste.org/70418
On Mon, Jun 25, 2012 at 2:16 PM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
On 25 June 2012 12:50, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hi
, Magicloud Magiclouds wrote:
Here is the code, I joined two modules in one paste. Both of them
cannot pass compiling.
http://hpaste.org/70418
On Mon, Jun 25, 2012 at 2:16 PM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com (mailto:ivan.miljeno...@gmail.com) wrote:
On 25 June 2012 12:50
the issue. None of us can compile your code, either,
because we're missing many of the dependencies, and unfortunately the issue
is no easier (for me) to track down with the full source listing in this case.
Cheers,
Arlen
On Monday, 25 June 2012 at 5:46 PM, Magicloud Magiclouds wrote:
Here
Even more weird, I installed container-0.5.0.0, and now it just compiled!
I will dig more of that. Sorry to bother you guys.
On Mon, Jun 25, 2012 at 5:53 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Interesting, seems like mapM did not effect the problem
Let me try more
Hi,
There was another mail, but the subject might be confusing. So I
write this one. The code is here: http://hpaste.org/70414
If I understand correct, generally, I could use 'type' to do alias
to save the ugly-long code. Like section 1. This works when I 't [(0,
Just x)]'.
But, if I wrote
OK. I found cabal-src tool, which solved this perfect.
On Wed, Jun 20, 2012 at 9:22 AM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hi,
The names here were just placeholder. And I just found out the reason.
Hackage magicloud is local (not from hackage.haskell.org
the solvers are using the status that is installed, not the
definitions from original hackages?
On Wed, May 2, 2012 at 2:47 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hi, long time no see.
I am using cabal-install-0.15.0. And the new solver. It sure solves
some problem. Thanks
Hi,
The names here were just placeholder. And I just found out the reason.
Hackage magicloud is local (not from hackage.haskell.org), there is
no its information in cabal INDEX (I assumed so). But this raised
another question, how to reference a local hackage in .cabal. So the
solver could use
:24 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
I think I need to think this through
On Thu, Jun 14, 2012 at 12:28 PM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
On 14 June 2012 14:20, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
OK. I think I
Sorry, the last 'a' of line 22 is 'b'.
On Thu, Jun 14, 2012 at 3:19 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
OK. I am totally confused here. Why Couldn't match expected type
`Jobs k e a' with actual type `M.Map k0 b0'
9|data JobInfo a e = (Exception e) =
10
And line 14, should be JobInfo a e.
I must be too sleepy
On Thu, Jun 14, 2012 at 3:30 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Sorry, the last 'a' of line 22 is 'b'.
On Thu, Jun 14, 2012 at 3:19 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
OK. I am
at 5:33 PM, Magicloud Magiclouds wrote:
And line 14, should be JobInfo a e.
I must be too sleepy
On Thu, Jun 14, 2012 at 3:30 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com (mailto:magicloud.magiclo...@gmail.com)
wrote:
Sorry, the last 'a' of line 22 is 'b'.
On Thu, Jun
Hi,
I've forgotten this.
This is OK:
type Job k a = Map k a
And this is OK:
{-# LANGUAGE RankNTypes #-} -- or LiberalTypeSynonyms?
type Job = forall a. forall k. Map k a
Then how to write it like this?
type Job = Map k a
--
竹密岂妨流水过
山高哪阻野云飞
And for G+, please use magiclouds#gmail.com.
*.
2012/6/13 Magicloud Magiclouds magicloud.magiclo...@gmail.com
Hi,
I've forgotten this.
This is OK:
type Job k a = Map k a
And this is OK:
{-# LANGUAGE RankNTypes #-} -- or LiberalTypeSynonyms?
type Job = forall a. forall k. Map k a
Then how to write it like this?
type Job = Map k
you have hidden them. But the
typechecker can use it to ensure some static property.
Also you could use unsafeCoerce to do some casts, but *only if you are
*sure* that things will go OK*.
2012/6/13 Magicloud Magiclouds magicloud.magiclo...@gmail.com
Hi,
I've forgotten this.
This is OK
String
}) to provide the guarantee that you're getting a Job (and not any Map Int
String) without performance loss.
Let me know if I've been more confusing than helpful;
Arlen
On Thursday, 14 June 2012 at 1:16 PM, Magicloud Magiclouds wrote:
Hi there,
Thanks for the reply. To be clear
I think I need to think this through
On Thu, Jun 14, 2012 at 12:28 PM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
On 14 June 2012 14:20, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
OK. I think I understand a little.
I use Job here just wants to simplify the code
A little information.
I did not notice the gcc/binutils versions. But in CentOS, the ghc
7.2.2/7.4.1 were all compiled myself with all default configurations.
On Tue, May 29, 2012 at 10:54 PM, Chris Dornan ch...@chrisdornan.com wrote:
On 29 May 2012 02:21, Magicloud Magiclouds
magicloud.magiclo
Sorry for the wrong information. I made a mistake when did the test.
After more testing, I think it is a bug of ghc 7.4.1. Until now, I
cannot find a way to make ghc 7.4.1 compiled binary work.
On Mon, May 28, 2012 at 11:01 AM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Alright
Interesting. I have this code tested in Debian unstable/stable, CentOS
6.1, all 64 bit, with two different version of libldap2.
At first, Debian-s were installed with 7.4.1, CentOS with 7.2.2. Only
in CentOS the code connected after compiled.
Then I removed 7.4.1 from Debian stable and installed
are we talking
about? (I don’t think I have tested this on GHC-7.4.1, and maybe the others
haven’t either.)
Chris
From: haskell-cafe-boun...@haskell.org
[mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Brandon Allbery
Sent: 25 May 2012 04:21
To: Magicloud Magiclouds
Cc: Haskell
be a 7.4.1 oddity but it looks as if it could be some
kind of GHC mis-installation.
(If trying this with GHC-7.0.4 would be bothersome I would be interested to
hear more; which O/S are you using?)
Chris
-Original Message-
From: Magicloud Magiclouds [mailto:magicloud.magiclo...@gmail.com
Hi,
I am writing a small program using LDAP hackage. A weird problem occured.
When the code was run by runhaskell, things were fine, worked as expected.
But when ghc compiled (no any args), and ran, I got this: LDAP
error: ldapSimpleBind: LDAPException LdapServerDown(-1): Can't contact
LDAP
run with
runhaskell.
Our directory server runs Active Directory.
On May 24, 2012, at 11:36 AM, Magicloud Magiclouds wrote:
Hi,
I am writing a small program using LDAP hackage. A weird problem occured.
When the code was run by runhaskell, things were fine, worked as expected.
But when
= ++ alias ++
)((objectClass=user)(!(ou=Recycle_Bin)
ldap - ldapInit domain ldapPort
ldapSimpleBind ldap bindDN bindPW
And ghc -threaded does not help.
On Fri, May 25, 2012 at 11:20 AM, Brandon Allbery allber...@gmail.com wrote:
On Thu, May 24, 2012 at 11:05 PM, Magicloud Magiclouds
Anyone could help on this?
On Fri, May 4, 2012 at 11:12 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Sorry to use Monad as the example, I meant this one:
run :: MonadTrans m = m IO a - IO a
And Daniel, I do not think adding another type b a good idea. Since
run could
Hi,
Assuming this:
run :: Monad IO a - IO a
data Test = Test { f }
Here I'd like to set f to run, like Test run. Then what is the type of f?
The confusing (me) part is that, the argument pass to f is not fixed
on return type, like f1 :: Monad IO (), f2 :: Monad IO Int. So
data Test a = Test
m = m a - IO a
Are you trying to make:
run :: IO a - IO a
??
2012/5/4 Magicloud Magiclouds magicloud.magiclo...@gmail.com
Hi,
Assuming this:
run :: Monad IO a - IO a
data Test = Test { f }
Here I'd like to set f to run, like Test run. Then what is the type of
f?
The confusing (me
Sorry to use Monad as the example, I meant this one:
run :: MonadTrans m = m IO a - IO a
And Daniel, I do not think adding another type b a good idea. Since
run could actually return any inside type (depending on another
function that passed to it). Even simple as different tuples would
destroy
Hi, long time no see.
I am using cabal-install-0.15.0. And the new solver. It sure solves
some problem. Thanks for the work.
Well, on the other hand, there still are hackages that I just have no
idea how the author make it (probably not up-to-date hackage
database). After human-solver checking,
suffered recently).
Maybe I should crack my cabal source to add an argument to ignore
version checking
On Fri, Feb 3, 2012 at 2:44 PM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
On 3 February 2012 17:29, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Thank you. The document
Glad to hear that. I will checkout the trunk and try.
On Fri, Feb 3, 2012 at 6:20 PM, Andres Löh andres.l...@googlemail.com wrote:
Hi.
On Fri, Feb 3, 2012 at 7:44 AM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
On 3 February 2012 17:29, Magicloud Magiclouds
magicloud.magiclo
experience
using cabal-dev made the problem go away.
I hope that clarifies.
Jason
On Fri, Feb 3, 2012 at 7:33 AM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Well, cabal-dev could not resolve the conflict of the diamond.
Because the conflict is depending different version
Hello,
As I recalled, ghc works in staticly link mode. So after one library
is compiled, all its build dependencies are useless. Lost, changed,
wheresoever, it does not matter.
Then why the problem of version conflicting exists?
By version conflicting I mean like following. This way, A is
.
It is not perfect, but would work sometimes
On Fri, Feb 3, 2012 at 2:04 PM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
On 3 February 2012 16:54, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hello,
As I recalled, ghc works in staticly link mode. So after one
Hi,
I have a Windows AD server. And ldapsearch tool works to get
someone's information. But when I turned it into Haskell code. It does
not work as expected.
Here is the ldapsearch and result. You can see that sn/givenName
have values that are encoded utf-8.
Next to it is the code I am
Hi,
With Prelude.catch, I could write catch () $ \_ - return Nothing.
But with Control.Exception.catch, I must specify a type for the _.
What should I do?
PS: In Java document, a function declaration would tell us both the
incoming args and outgoing, AND what exceptions would it throw. But it
...@gmail.com wrote:
On 01/12/12 13:03, Magicloud Magiclouds wrote:
Hi,
With Prelude.catch, I could write catch () $ \_ - return Nothing.
But with Control.Exception.catch, I must specify a type for the _.
What should I do?
Use SomeException for the type, as it is the base of the exception
hierarchy
Thank you so much. I was always confused by what exception should I catch.
On Thu, Jan 12, 2012 at 3:49 PM, Gregory Crosswhite
gcrosswh...@gmail.com wrote:
On 01/12/12 16:58, Magicloud Magiclouds wrote:
Yes, that is a problem. But consider my PS in original mail, I have no
idea what exception
Hi,
I am using LDAP hackage to do some ldap searching. I am not sure if
this is its problem. All Chinese chars returned like \29579.
How to convert it to the actual Chinese char? I thought it was my
terminal's fault, so tried to use System.IO.UTF8 to put the result
into a file and viewed by
characters with a codepoint 127.
2012/1/10 Magicloud Magiclouds magicloud.magiclo...@gmail.com:
Hi,
I am using LDAP hackage to do some ldap searching. I am not sure if
this is its problem. All Chinese chars returned like \29579.
How to convert it to the actual Chinese char? I thought it was my
From the code, I think it is what I want. But still, I need some time
to understand it
Anyway, thank you.
On Thu, Nov 17, 2011 at 4:02 PM, o...@okmij.org wrote:
Multi-parameter type classes are more flexible. Here is how you can
write your old code:
{-# LANGUAGE MultiParamTypeClasses,
Hi,
Consider I have declarations like this:
class (ClassA a) = ClassC a where
from :: (ClassB b) = a - [b]
to :: (ClassB c) = a - [c]
data H = ...
instance ClassB H where
...
data Test = Test { m :: H }
instance ClassA Test where
...
instance ClassC Test where
from = m
to = m
On Thu, Nov 17, 2011 at 11:48 AM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hi,
Consider I have declarations like this:
class (ClassA a) = ClassC a where
from :: (ClassB b) = a - [b]
to :: (ClassB c) = a - [c]
data H = ...
instance ClassB H where
...
data Test
], but you're trying to
implement it as Test - H.
On 17 Nov 2011, at 07:48, Magicloud Magiclouds wrote:
Hi,
Consider I have declarations like this:
class (ClassA a) = ClassC a where
from :: (ClassB b) = a - [b]
to :: (ClassB c) = a - [c]
data H = ...
instance ClassB H where
On Thu, Nov 17, 2011 at 1:17 PM, Brandon Allbery allber...@gmail.com wrote:
On Wed, Nov 16, 2011 at 23:54, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
I think this is where I did not understand from the very beginning.
If the the declaration was correct, then why cannot b be H
, Nov 6, 2011 at 14:35, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hi,
I'd like to simpler the work of deriving MyClass. And I have two
ways to do: TemplateHaskell $(derivingMyClass), or Generic deriving
(MyClass).
Since I need to get the type name in the deriving, then I met
Hi,
I'd like to simpler the work of deriving MyClass. And I have two
ways to do: TemplateHaskell $(derivingMyClass), or Generic deriving
(MyClass).
Since I need to get the type name in the deriving, then I met this
question: If I have data A b = C b, then with TemplateHaskell, the
type would
2011/11/1 José Pedro Magalhães j...@cs.uu.nl:
Oh, right, I see that some things on that page need updating; I'll do so.
Thanks,
Pedro
On Tue, Nov 1, 2011 at 09:33, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
On Tue, Nov 1, 2011 at 1:59 PM, Andres Löh andres.l
Hi,
I am learning the new generic feature of ghc. I'd have to say, it is
harder than template to enter.
When I started to learn template, ghc -ddump-slices really helped.
So I wonder if I could get the representation generated when deriving
Generic. I think that would be a great help.
--
On Tue, Nov 1, 2011 at 5:42 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hi,
I have code as following, to make a toDocument function (using
Data.Bsin.=:) for a data structure.
bson :: DecsQ - DecsQ
bson decsq = do
decs - decsq
let datad = head decs
DataD
On Wed, Nov 2, 2011 at 4:08 PM, Max Bolingbroke
batterseapo...@hotmail.com wrote:
On 2 November 2011 07:42, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
How to avoid the name changing?
Maybe you should use nameBase rather than show?
Max
Yes, that is one of the problem
On Wed, Nov 2, 2011 at 4:50 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
On Wed, Nov 2, 2011 at 4:08 PM, Max Bolingbroke
batterseapo...@hotmail.com wrote:
On 2 November 2011 07:42, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
How to avoid the name changing
On Tue, Nov 1, 2011 at 1:59 PM, Andres Löh andres.l...@googlemail.com wrote:
Hi.
I do not know why, my ghc 7.2.1 does not seem to support
DeriveRepresentable. I compiled the ghc 7.2.1 myself by ghc 7.0.4. All
options default.
$ ghc Types/TopTalkerRecord.hs
Types/TopTalkerRecord.hs:2:14:
Hi,
I have code as following, to make a toDocument function (using
Data.Bsin.=:) for a data structure.
bson :: DecsQ - DecsQ
bson decsq = do
decs - decsq
let datad = head decs
DataD _ _ _ cons _ = datad
to = mkName toDocument
from = mkName fromDocument
fund - mapM (\con
Hi,
I do not know why, my ghc 7.2.1 does not seem to support
DeriveRepresentable. I compiled the ghc 7.2.1 myself by ghc 7.0.4. All
options default.
$ ghc Types/TopTalkerRecord.hs
Types/TopTalkerRecord.hs:2:14:
Unsupported extension: DeriveRepresentable
$ ghc --version
The Glorious
On Thu, Oct 27, 2011 at 7:04 AM, Evan Laforge qdun...@gmail.com wrote:
No, this lists all the instances of a class. OP asked for the classes
of which a given type is an instace.
Presumably it is possible, since Haddock does it! In the
documentation generated for a type it lists classes of
On Thu, Oct 27, 2011 at 1:57 AM, Brent Yorgey byor...@seas.upenn.edu wrote:
On Wed, Oct 26, 2011 at 09:10:23PM +0400, MigMit wrote:
Can't be done. Even if this particular module doesn't contain
instance Class Type, it's quite possible that the said instance
would be defined in another module,
Hi,
If this was in ruby or other languages that support reflection, it
won't be a question.
But in Haskell, could I write a code to list the classes that a type
instanced?
TemplateHaskell as well.
--
竹密岂妨流水过
山高哪阻野云飞
___
Haskell-Cafe mailing list
Hi there,
I am using the toJson = id way, which doesn't seem to cause other problem.
Thank you.
On Mon, Oct 3, 2011 at 11:18 PM, Steffen Schuldenzucker
sschuldenzuc...@uni-bonn.de wrote:
On 10/03/2011 10:42 PM, Magicloud Magiclouds wrote:
Hi,
I have a function:
post :: (ToJson p
it through
aspecial preprocessor.
1 - http://www.haskell.org/ghc/docs/7.2.1/html/users_guide/hsc2hs.html2
- http://www.cse.unsw.edu.au/~chak/haskell/c2hs/3 -
http://stackoverflow.com/questions/6009031/difference-between-hsc2hs-and-c2hs
2011/10/3 Magicloud Magiclouds magicloud.magiclo
Hi,
I have a function:
post :: (ToJson p, FromJson q) = String - String - String -
Map.Map String p - IO q
Now I'd like to call it like:
r - post site token user.addMedia (Map.fromList [ (users, users :: ToJson)
, (medias, medias
:: ToJson) ])
Hi,
I am trying to use data-flags library. And failed on compiling the test code.
The code is like following, and the compiling error is
test.hs:4:24: parse error on input `{'
{-# LANGUAGE TemplateHaskell #-}
import Data.Flags.TH
$(bitmaskWrapper Severity ''Int [] False
[ (NotClassified,
On Mon, Oct 3, 2011 at 1:44 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hi,
I am trying to use data-flags library. And failed on compiling the test code.
The code is like following, and the compiling error is
test.hs:4:24: parse error on input `{'
{-# LANGUAGE
Hi,
I am learning to use data-flags, and got this example code:
import Data.Flags
newtype MyFlags = MyFlags CInt deriving (Eq, Flags)
#{enum MyFlags, MyFlags
, myFlag1 = C_FLAG1
, myFlag2 = C_FLAG2
, myFlag3 = C_FLAG3
}
I modified it trying to compile it. Well, I got illegal syntax at
1 - 100 of 212 matches
Mail list logo