Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/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: Check constructor's field numeric value at compile time
(David Virebayre)
2. hpc doctest (ryan)
----------------------------------------------------------------------
Message: 1
Date: Mon, 8 Sep 2014 16:31:54 +0200
From: David Virebayre <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Check constructor's field numeric
value at compile time
Message-ID:
<CAM_wFVsRV8BjC5=2raafmdoq3taextc0pffhpnuuumhamp3...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
2014-09-03 5:07 GMT+02:00 Kim-Ee Yeoh <[email protected]>:
>
> On Wed, Sep 3, 2014 at 2:32 AM, Dmitriy Matrosov <[email protected]>
> wrote:
>
>> How can i write this constraints so they're checked at compile time, not
>> at runtime?
>
>
> Smart constructors won't check them at compile time but it does the next
> best thing, which is validate at the earliest possible moment.
>
In between compile time and runtime, you probably could use refinements
types; see LiquidHaskell (http://goto.ucsd.edu:8090/index.html,
https://github.com/ucsd-progsys/liquidhaskell/ )
David.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20140908/b9340c2e/attachment-0001.html>
------------------------------
Message: 2
Date: Mon, 08 Sep 2014 14:03:49 -0400
From: ryan <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] hpc doctest
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
Hello,
Are there any known issues with doctest and hpc?
Cabal test runs correctly, but hpc doesn't seem to see anything. I have
tried to make some of the test fail on purpose so see it hpc would pick
it up, since there is additional output from cabal test when there is a
failure, but it doesn't help.
--
-- test file
--
module Doctests where
import Test.DocTest
main :: IO ()
main = doctest ["-isrc", "src/Ch1.hs"]
--
-- command line
--
$ cabal test
Building DiscreteMathematicsUsingAComputer-0.1.0.0...
Preprocessing library DiscreteMathematicsUsingAComputer-0.1.0.0...
In-place registering DiscreteMathematicsUsingAComputer-0.1.0.0...
Preprocessing test suite 'doctests' for
DiscreteMathematicsUsingAComputer-0.1.0.0...
Warning: output was redirected with -o, but no output will be generated
because there is no Main module.
Running 1 test suites...
Test suite doctests: RUNNING...
Test suite doctests: PASS
Test suite logged to:
dist/test/DiscreteMathematicsUsingAComputer-0.1.0.0-doctests.log
Writing: hpc_index.html
Writing: hpc_index_fun.html
Writing: hpc_index_alt.html
Writing: hpc_index_exp.html
Test coverage report written to dist/hpc/html/doctests/hpc_index.html
1 of 1 test suites (1 of 1 test cases) passed.
Writing: hpc_index.html
Writing: hpc_index_fun.html
Writing: hpc_index_alt.html
Writing: hpc_index_exp.html
Package coverage report written to
dist/hpc/html/DiscreteMathematicsUsingAComputer-0.1.0.0/hpc_index.html
Ryan
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 75, Issue 6
****************************************