Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1. Re:  Is it possible such Monad? (Baa) (鲍凯文)
   2. Re:  Is it possible such Monad? (Baa) (Baa)
   3.  What's wrong with Haddock?! (Baa)
   4. Re:  What's wrong with Haddock?! (Francesco Ariis)
   5. Re:  What's wrong with Haddock?! (Sylvain Henry)
   6. Re:  What's wrong with Haddock?! (Baa)
   7. Re:  What's wrong with Haddock?! (Francesco Ariis)


----------------------------------------------------------------------

Message: 1
Date: Thu, 26 Oct 2017 02:07:39 +0000
From: 鲍凯文 <traqueofzi...@gmail.com>
To: beginners@haskell.org
Subject: Re: [Haskell-beginners] Is it possible such Monad? (Baa)
Message-ID:
        <camjcg+eikwpp4tvz3ahzfd93gxyfuuhqjgp2op2sno+zpdk...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi,

1. I think your data type is isomorphic to

data Allpass w m a = Pass Bool (m a) w

2. Maybe first try to write a Functor instance? Then you can find out what
constraints are necessary for 'w' and 'm' to write it.

3. What does this data type intend to represent?

Best,

toz

On Wed, Oct 25, 2017 at 5:32 AM <beginners-requ...@haskell.org> wrote:

> Send Beginners mailing list submissions to
>         beginners@haskell.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> or, via email, send a message with subject or body 'help' to
>         beginners-requ...@haskell.org
>
> You can reach the person managing the list at
>         beginners-ow...@haskell.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Beginners digest..."
>
>
> Today's Topics:
>
>    1.  Is it possible such Monad? (Baa)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 25 Oct 2017 13:56:31 +0300
> From: Baa <aqua...@gmail.com>
> To: The Haskell-Beginners Mailing List - Discussion of primarily
>         beginner-level topics related to Haskell <beginners@haskell.org>
> Subject: [Haskell-beginners] Is it possible such Monad?
> Message-ID: <20171025135631.1f9913d2@Pavel>
> Content-Type: text/plain; charset=US-ASCII
>
> Hello All!
>
> Is it possible to write Monad for such type:
>
>   data Allpass w m a = Nopass (m a) w | Allpass (m a) w
>
> I can write (>>=), IMHO such type can not be Monad due to `w` is not
> under `m` monad, right?
>
>
> ===
> Best regards, Paul
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
> ------------------------------
>
> End of Beginners Digest, Vol 112, Issue 22
> ******************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20171026/376b39c4/attachment-0001.html>

------------------------------

Message: 2
Date: Thu, 26 Oct 2017 10:54:04 +0300
From: Baa <aqua...@gmail.com>
To: beginners@haskell.org
Subject: Re: [Haskell-beginners] Is it possible such Monad? (Baa)
Message-ID: <20171026105404.15f6bd24@Pavel>
Content-Type: text/plain; charset=US-ASCII

Primary idea was to keep error messages. OK, I done it with `State`
monad :)

Thank you!

> Hi,
> 
> 1. I think your data type is isomorphic to
> 
> data Allpass w m a = Pass Bool (m a) w
> 
> 2. Maybe first try to write a Functor instance? Then you can find out
> what constraints are necessary for 'w' and 'm' to write it.
> 
> 3. What does this data type intend to represent?
> 
> Best,
> 
> toz
> 
> On Wed, Oct 25, 2017 at 5:32 AM <beginners-requ...@haskell.org> wrote:
> 
> > Send Beginners mailing list submissions to
> >         beginners@haskell.org
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> >         http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> > or, via email, send a message with subject or body 'help' to
> >         beginners-requ...@haskell.org
> >
> > You can reach the person managing the list at
> >         beginners-ow...@haskell.org
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of Beginners digest..."
> >
> >
> > Today's Topics:
> >
> >    1.  Is it possible such Monad? (Baa)
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Wed, 25 Oct 2017 13:56:31 +0300
> > From: Baa <aqua...@gmail.com>
> > To: The Haskell-Beginners Mailing List - Discussion of primarily
> >         beginner-level topics related to Haskell
> > <beginners@haskell.org> Subject: [Haskell-beginners] Is it possible
> > such Monad? Message-ID: <20171025135631.1f9913d2@Pavel>
> > Content-Type: text/plain; charset=US-ASCII
> >
> > Hello All!
> >
> > Is it possible to write Monad for such type:
> >
> >   data Allpass w m a = Nopass (m a) w | Allpass (m a) w
> >
> > I can write (>>=), IMHO such type can not be Monad due to `w` is not
> > under `m` monad, right?
> >
> >
> > ===
> > Best regards, Paul
> >
> >
> > ------------------------------
> >
> > Subject: Digest Footer
> >
> > _______________________________________________
> > Beginners mailing list
> > Beginners@haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> >
> >
> > ------------------------------
> >
> > End of Beginners Digest, Vol 112, Issue 22
> > ******************************************
> >  



------------------------------

Message: 3
Date: Thu, 26 Oct 2017 13:03:56 +0300
From: Baa <aqua...@gmail.com>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: [Haskell-beginners] What's wrong with Haddock?!
Message-ID: <20171026130356.0a802023@Pavel>
Content-Type: text/plain; charset=UTF-8

I often hit such errors:

  parse error on input ‘-- ^ my doc-string is here’

when generate Haddock documentation. This happens on line like:

  instance Something UTCTime where
    some a = blahBlah -- ^ my doc-string is here

Sometimes such doc-strings are passing, sometimes - not. I can
understand what is the reason. Is there some rule how to format such
kind of doc-strings?


===
Cheers, Paul


------------------------------

Message: 4
Date: Thu, 26 Oct 2017 12:25:52 +0200
From: Francesco Ariis <fa...@ariis.it>
To: beginners@haskell.org
Subject: Re: [Haskell-beginners] What's wrong with Haddock?!
Message-ID: <20171026102552.qu3hglm2gy74n...@x60s.casa>
Content-Type: text/plain; charset=us-ascii

On Thu, Oct 26, 2017 at 01:03:56PM +0300, Baa wrote:
> Sometimes such doc-strings are passing, sometimes - not. I can
> understand what is the reason. Is there some rule how to format such
> kind of doc-strings?

Hello Paul, can you provide an example of a docstring which makes
Haddock choke?


------------------------------

Message: 5
Date: Thu, 26 Oct 2017 12:31:58 +0200
From: Sylvain Henry <sylv...@haskus.fr>
To: beginners@haskell.org
Subject: Re: [Haskell-beginners] What's wrong with Haddock?!
Message-ID: <2bc9ddbb-c603-c9a9-d8d5-115cd14fb...@haskus.fr>
Content-Type: text/plain; charset=utf-8; format=flowed

Just remove the `^` character. `|` and `^` (attaching the comment to the 
next/previous entity) can't be used everywhere.


On 26/10/2017 12:03, Baa wrote:
> I often hit such errors:
>
>    parse error on input ‘-- ^ my doc-string is here’
>
> when generate Haddock documentation. This happens on line like:
>
>    instance Something UTCTime where
>      some a = blahBlah -- ^ my doc-string is here
>
> Sometimes such doc-strings are passing, sometimes - not. I can
> understand what is the reason. Is there some rule how to format such
> kind of doc-strings?
>
>
> ===
> Cheers, Paul
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners



------------------------------

Message: 6
Date: Thu, 26 Oct 2017 14:11:10 +0300
From: Baa <aqua...@gmail.com>
To: beginners@haskell.org
Subject: Re: [Haskell-beginners] What's wrong with Haddock?!
Message-ID: <20171026141110.4647a635@Pavel>
Content-Type: text/plain; charset=US-ASCII

@Francesco Ariis:

  instance Conversion UTCTime where
    aspS a = round $ 1E12 * utcTimeToPOSIXSeconds a -- ^as time period from 
1970-1-1
    frompS a = posixSecondsToUTCTime $ fromInteger $ (round $ d/1E12) -- ^from 
time period from 1970-1-1
      where d = fromInteger a :: Double

@Sylvain: sure I can remove "^", but in this case in will be comment,
not doc-string; am I right, or? I want to add this string to Haddock
generated documentation.

So, I see that sometimes no problem with "^..."-style docstrings
(attached? or how is it called correctly?). But sometimes their lead to
errors.


> On Thu, Oct 26, 2017 at 01:03:56PM +0300, Baa wrote:
> > Sometimes such doc-strings are passing, sometimes - not. I can
> > understand what is the reason. Is there some rule how to format such
> > kind of doc-strings?  
> 
> Hello Paul, can you provide an example of a docstring which makes
> Haddock choke?
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners



------------------------------

Message: 7
Date: Thu, 26 Oct 2017 13:34:38 +0200
From: Francesco Ariis <fa...@ariis.it>
To: beginners@haskell.org
Subject: Re: [Haskell-beginners] What's wrong with Haddock?!
Message-ID: <20171026113438.p3o2ihbyeofal...@x60s.casa>
Content-Type: text/plain; charset=us-ascii

On Thu, Oct 26, 2017 at 02:11:10PM +0300, Baa wrote:
> @Francesco Ariis:
> 
>   instance Conversion UTCTime where
>     aspS a = round $ 1E12 * utcTimeToPOSIXSeconds a -- ^as time period from 
> 1970-1-1
>     frompS a = posixSecondsToUTCTime $ fromInteger $ (round $ d/1E12) -- 
> ^from time period from 1970-1-1
>       where d = fromInteger a :: Double

-- ^ is meant to be put after a function *declaration* iirc. Try to
add signatures to your instance as

    instance Foo Bar where
        fa :: Int -> a    -- ^ some comment
        fa x = undefined
        fb :: String -> a    -- ^ some more comment
        fb x = undefined

and let us know if it fixed the problem.


------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 112, Issue 23
******************************************

Reply via email to