Send Beginners mailing list submissions to
        [email protected]

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
        [email protected]

You can reach the person managing the list at
        [email protected]

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


Today's Topics:

   1. Re:  Debugging in Haskell (m00nlight)
   2. Re:  Debugging in Haskell (Henk-Jan van Tuyl)
   3. Re:  Need help to write join on my Temporals (martin)
   4.  Linebreaks in lhs2tex eval (martin)


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

Message: 1
Date: Sun, 12 Apr 2015 14:16:14 +0800 (CST)
From: m00nlight <[email protected]>
To: "The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell" <[email protected]>
Subject: Re: [Haskell-beginners] Debugging in Haskell
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Emacs can be configured to look great, see the following quora answer for 
example. You can just try to get used to it and
add your configuration incremently. After a few time, it will be of beautiful 
appearance.

http://www.quora.com/How-can-I-go-from-good-to-great-in-Emacs







--m00nlight



?2015?04?10 08?18?, "Dimitri DeFigueiredo"<[email protected]>??:

             I did try to use Leksah, but did not like the interface. I don't   
 think it helped with debugging, but may be mistaken. I'm now using    sublime 
3 and hoping that someday I will be able to use Atom. Emacs    appears to be 
the standard, but it is just too ugly for me.
   
   Dimitri
   
   
   
On 09/04/15 02:03, emacstheviking      wrote:
   
That's interesting.
         
         I must confess that I find the need to debug in Haskell          
greatly reduced because I tend to design stuff in small          incremental 
steps in ghci / emac in a Lisp like way which          means that I am 
reasoning out my code as I write it which          usually means there are no 
logical bugs at least.
       

       However I can see the need on occasion to maybe debug into        issues 
relating to threads / STM and behaviours between        processes in general.
       
       Have you tried using Leksah, the Haskell IDE?
       
       
     

       
On 9 April 2015 at 02:21, Dimitri          DeFigueiredo 
<[email protected]>          wrote:
         I need to            improve my Haskell debugging skills. I know of 
quickcheck,            but that's for testing. It seems that:
           
           - Debug.Trace and
           - dynamic breakpoints in GHCi
           
           Are the two easy ways to check the state of your program at          
  a specific point in execution.
           Is there another simple tool that I should know about? Any           
 tips?
           
           Thank you,
           
           Dimitri
           
           _______________________________________________
           Beginners mailing list
           [email protected]
           http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
         

     

     
     
_______________________________________________
Beginners mailing 
[email protected]http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20150412/e22cf95b/attachment-0001.html>

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

Message: 2
Date: Sun, 12 Apr 2015 11:09:25 +0200
From: "Henk-Jan van Tuyl" <[email protected]>
To: "The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell" <[email protected]>,
        "Dimitri DeFigueiredo" <[email protected]>
Subject: Re: [Haskell-beginners] Debugging in Haskell
Message-ID: <op.xwy2d4mnpz0j5l@alquantor>
Content-Type: text/plain; charset=iso-8859-15; format=flowed;
        delsp=yes

On Thu, 09 Apr 2015 03:21:05 +0200, Dimitri DeFigueiredo  
<[email protected]> wrote:

> I need to improve my Haskell debugging skills. I know of quickcheck, but  
> that's for testing. It seems that:
>
> - Debug.Trace and
> - dynamic breakpoints in GHCi
>
> Are the two easy ways to check the state of your program at a specific  
> point in execution.
> Is there another simple tool that I should know about? Any tips?

GHC 7.10 can generate debug information, see the Release notes for version  
7.10.1 [0].

Regards,
Henk-Jan van Tuyl


[0]  
https://downloads.haskell.org/~ghc/7.10.1/docs/html/users_guide/release-7-10-1.html

-- 
Folding@home
What if you could share your unused computer power to help find a cure? In  
just 5 minutes you can join the world's biggest networked computer and get  
us closer sooner. Watch the video.
http://folding.stanford.edu/


http://Van.Tuyl.eu/
http://members.chello.nl/hjgtuyl/tourdemonad.html
Haskell programming
--


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

Message: 3
Date: Sun, 12 Apr 2015 11:49:13 +0200
From: martin <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Need help to write join on my
        Temporals
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252

So I have a solution now, it passes my tests but it is ugly. While I am 
unnesting I sometimes have to add the default as
a new change and sometimes add the last old change with its time advanced.

The problem is, I don't really know the semantics of a Temporal Temporal, but I 
know the semantics of <*> and that <*>
must be the same as `ap`.

Any comments will be very welcome.

-- cBetween :: Time -> Time -> [Change a] -> [Change a]
-- cAfter   :: Time -> [Change a] -> [Change a]
-- cBefore  :: Time -> [Change a] -> [Change a]


tJoin :: Temporal (Temporal a) -> Temporal a
tJoin (Temporal tdef []) = tdef
tJoin tp@(Temporal tdef ctps)
        | null cs'  =  Temporal (td tdef) (tj ctps)
        | otherwise =  Temporal (td tdef) (cs' ++ tj' ctps)
        where
            cs  = tc tdef
            cs' = cBefore (ct $ head ctps) cs

tj, tj' :: [Change (Temporal a)] -> [Change a]

-- before first change was found
tj  ((Chg t (Temporal d [])):[])  =  [Chg t d]
tj  ((Chg t (Temporal d cs)):[])  =  preDef t d cs (cAfter t cs)

tj  ((Chg t (Temporal d [])):cts) =  (Chg t d) : (tj cts)
tj  ((Chg t (Temporal d cs)):cts)
        | null cs'  =  preDef t d cs (tj cts)
        | otherwise =  preDef t d cs cs' ++ (tj' cts)
          where
              cs' = cBetween t (ct $ head cts) cs

-- after first change was found
tj' ((Chg t (Temporal d cs)):[]) =  preC0 t cs (cAfter t cs)

tj' ((Chg t (Temporal d cs)):cts) =  preC0 t cs cs' ++ (tj' cts)
          where
              cs' =  cBetween t (ct $ head cts) cs

-- prepend first change if required
preC0 t cs cs'
        | null bef   = cs'
        | tx == t    = cs'
        | otherwise  = (Chg t vx) : cs'
        where
            bef          = cBefore' t cs
            (Chg tx vx)  = last bef

-- prepend default as new change
preDef t d cs cs'
        | null cs   = cs'
        | t == tx   = cs'
        | otherwise = (Chg t d) : cs'
        where
            (Chg tx vx) = head cs





Am 04/10/2015 um 07:02 PM schrieb martin:

> type Time = Integer
> data Change a = Chg {
>             ct :: Time, -- "change time"
>             cv :: a     -- "change value"
>         } deriving (Eq,Show)
> 
> data Temporal a = Temporal {
>     td :: a,         -- "temporal default"
>     tc :: [Change a] -- "temporal changes"
> } deriving (Eq, Show)



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

Message: 4
Date: Sun, 12 Apr 2015 13:55:45 +0200
From: martin <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] Linebreaks in lhs2tex eval
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8

Hello all,

it appears lhs2tex's \eval command does not show linebreaks. This is a pity, 
particularly when the output is formatted
with a pretty printer.

Is there a way to teach \eval to respect the linebreaks?


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

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


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

End of Beginners Digest, Vol 82, Issue 11
*****************************************

Reply via email to