Haskell-Cafe
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- 7 participants
- 29676 discussions
Florian Lorenzen wrote:
> Now, I'd like to have a function
> > typecheck :: Exp -> Maybe (Term t)
> > typecheck exp = <...>
> that returns the GADT value corresponding to `exp' if `exp' is type
> correct.
Let us examine that type:
typecheck :: forall t. Exp -> Maybe (Term t)
Do you really mean that given expression exp, (typecheck exp) should
return a (Maybe (Term t)) value for any t whatsoever? In other words,
you are interested in a type-*checking* problem: given an expression _and_
given a type, return Just (Term t) if the given expression has the given
type. Both expression and the type are the input. Incidentally, this
problem is like `read': we give the read function a string
and we should tell it to which type to parse. If that is what you
mean, then the solution using Typeable will work (although you may
prefer avoiding Typeable -- in which case you should build type
witnesses on your own).
> that returns the GADT value corresponding to `exp' if `exp' is type
> correct.
Your comment suggests that you mean typecheck exp should return
(Just term) just in case `exp' is well-typed, that is, has _some_
type. The English formulation of the problem already points us towards
an existential. The typechecking function should return (Just term)
and a witness of its type:
typecheck :: Exp -> Sigma (t:Type) (Term t)
Then my
> data TypedTerm = forall ty. (Typ ty) (Term ty)
is an approximation of the Sigma type. As Erik Hesselink rightfully
pointed out, this type does not preclude type transformation
functions. Indeed you have to unpack and then repack. If you
want to know the concrete type, you can pattern-match on the type
witness (Typ ty), to see if the inferred type is an Int, for example.
Chances are that you wanted the following
typecheck :: {e:Exp} -> Result e
where Result e has the type (Just (Term t)) (with some t dependent on
e) if e is typeable, and Nothing otherwise. But this is a dependent
function type (Pi-type). No wonder we have to go through contortions
like Template Haskell to emulate dependent types in Haskell. Haskell
was not designed to be a dependently-typed language.
2
1
Hello,
I'm pleased to announce the release of Juicy.Pixels (a pure Haskell
library for image loading and writing) in version 2.0.
The new features of this version are a Gif file decoder, and a rework of
the plane extraction part to be type safe
github: https://github.com/Twinside/Juicy.Pixels
hackage: http://hackage.haskell.org/package/JuicyPixels
Thanks
Vincent Berthoux
1
0
import Text.Regex
date_by_ntday dateStr ntday = do
let [y,m,d] = map (\x -> read x::Int) $ splitRegex (mkRegex "-") dateStr
....
%ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.1
Which package(s) do i need to use Text.Regex ?
Sincerely!
-----
fac n = foldr (*) 1 [1..n]
--
View this message in context: http://old.nabble.com/Could-not-find-module-%60Text.Regex%27-tp27366745p273ā¦
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
5
5
LinkedIn
------------
Sakari Joinen requested to add you as a connection on LinkedIn:
------------------------------------------
Steve,
I'd like to add you to my professional network on LinkedIn.
- Sakari
Accept invitation from Sakari Joinen
http://www.linkedin.com/e/uc6lxc-h70llpqy-2x/XvIdBwmueHfd6vFMPXXdLaqreCbl5oā¦
View profile of Sakari Joinen
http://www.linkedin.com/e/uc6lxc-h70llpqy-2x/rso/203924390/GIO8/name/259079ā¦
------------------------------------------
You are receiving Invitation emails.
This email was intended for Steve Severance.
Learn why this is included: http://www.linkedin.com/e/uc6lxc-h70llpqy-2x/plh/http%3A%2F%2Fhelp%2Elinkedā¦
(c) 2012, LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.
6
5
I'm pleased to announce the release of darcsden 1.0!
darcsden is a web application for browsing and managing darcs repositories
(and issue trackers, and their owners), and an SSH server which lets users
push changes to the app without needing a full system login. It can be
used for browsing your local repositories, for publishing your repos on
the web, or for running a public repo hosting site. It is available under
the BSD license.
darcsden was created by Alex Suraci. The last release was 0.5, in 2010.
I've been tinkering with it and using it to publish repos on my site for a
while. In recent months, with help from the Darcs community I made a
serious attempt to make it more robust and to run a reliable instance at
http://hub.darcs.net , with promising results. Alex and I feel this is a
good time to release an official darcsden 1.0, containing hub's
reliability/functionality updates (but not the UI style tweaks).
Home: http://hackage.haskell.org/package/darcsden
Release notes:
--------------
Changes in this release fall into several themes:
Deployability/Hackability
* dependencies have been updated; darcsden now uses the latest GHC,
darcs and snap
* cabal build flags have been added:
- darcs28: build with released darcs 2.8.2+ instead of latest
darcs-screened ? default: true
- ssh, closing, highlighting: build the ssh server, issue-closing
script, and highlighting features ? default: true (disable these
for easier building on windows)
* settings allowing easier custom deployment are available in
src/DarcsDen/Settings.hs: base hostname, path and URL, home link,
front page content, root directory, log files, maximum request time,
maximum displayable patch/file size, database hosts/ports, etc.
* the db setup required for issue trackers has been added
* the register form has a security question to reduce junk signups
* issue trackers can be enabled/disabled per-repo
* a robots.txt file has been added (default: allow all bots)
* non-content pages now have NOINDEX meta tag to discourage search
indexing
* user repos and log files have moved to subdirectories for easier
management
* a makefile has been added for developer convenience
Reliability
* error messages are more user-friendly
* intermittent browsing errors and eventual stylesheet loss due to
non-thread-safe working directory in libdarcs have been fixed
* viewing a patch or file with binary data no longer gives an error
* patch content larger than 200K is elided, avoiding some timeouts
* viewing a patch shows the page right away and fetches the patch data
asynchronously, with a more friendly message if it times out
* viewing a non-existent patch id shows a 404 instead of an exception
* source code highlighting is faster (using highlighting-kate); viewing
a complex file (like minified jquery.js) no longer times out
* the error-prone repo bootstrap feature has been dropped
* patch author names are now replaced with user links reliably (when the
email address matches)
* repo links now work when the current url ends in /
* . (period) is supported in repo names
* merge now redirects properly when it completes
* the login button in the issue tracker now works
* private repos are now listed for their owners
* private repos are no longer darcs gettable by non-owners
* patch author names now link to local users and hide email addresses
reliably
* input fields now accept at most 1000 characters
* ssh access now supports DSA public keys
Usability
* the site favicon now works in Chrome
* the register form now disables browser autofill and is readable in
Chrome
* navigation buttons are clearer and more context-sensitive
* the front page remains accessible after login
* users are listed on the front page
* repos are listed alphabetically
* page headings are more consistent when browsing files
* files view displays directory names in bold
* when viewing file content, long lines now use all space to window edge
* all markdown files are now rendered as markdown, not just README
* the patches view has been renamed branches, and shows all related
repos including upstream
* merging patches can now also be done by repo members
* pagination controls also appear at the top and have a stable layout
for easy clicking
* patch view lists files alphabetically
* patch view now also displays added/removed file content
* all issues, closed issues views have been added
* code blocks on issue pages no longer overflow their background
* list styles have been improved in markdown
* button transition, border radius and box shadow styles have been
updated for modern browsers
Credits:
--------
Alex Suraci created darcsden. Simon Michael led this release, with help
from Ganesh Sittampalam, Guillaume Hoffmann, Niklas Haas, Daniel
Patterson, Owen Stephens and Scott Lawrence.
darcsden depends on Darcs, Snap, GHC, and the rest of the Haskell
ecosystem.
Contributing:
-------------
I think darcsden fills a strategic niche in the Darcs ecosystem and
deserves wider use and more active development. It has a small, clean
codebase and is fun to hack on, not least because (if you contribute to
hub's darcsden branch) useful changes will quickly be deployed at
hub.darcs.net, providing a tight dogfooding/feedback loop. Here's how to
contribute a patch there:
- register at hub.darcs.net, add your ssh key in settings
- fork http://hub.darcs.net/simon/darcsden
- darcs get http://hub.darcs.net/yourname/darcsden
- (edit, record)
- darcs push yourname@hub.darcs.net:darcsden
- your change appears at http://hub.darcs.net/simon/darcsden/patches ;
ping me by IRC or email to merge it
Best,
-Simon, Alex and the Darcs team
1
1
I am happy to announce a new version of Groundhog, a library for fast
high-level database access:
http://hackage.haskell.org/package/groundhog
http://hackage.haskell.org/package/groundhog-th
http://hackage.haskell.org/package/groundhog-postgresql
http://hackage.haskell.org/package/groundhog-sqlite
Groundhog has been completely overhauled since the last release.
Notably, it got support for PostgreSQL and natural foreign keys. I
believe that it is a big step forward as this brings more flexibility
to the design of the relational schemas while keeping the applications
independent of the storage layer. Some of the solutions, particularly
schema migration were based on Persistent code.
Please see examples at http://github.com/lykahb/groundhog/tree/master/examples.
Features:
* Support for Sqlite and PostgreSQL.
* Natural and composite foreign keys. Earlier it was possible to
reference an entity only by the mandatory integer primary key. Now an
entity can have several keys including autoincrement primary key
(optional) and unique keys which have one or more columns.
* Full support of embedded datatypes. You can access a field that
contains an embedded datatype as a whole, or access some of the inner
subfields individually. This powerful mechanism has allowed
implementation of the composite keys, and can be used in future to
work with PostgreSQL composite types or MongoDB embedded documents.
Instead of serializing value to string, the Groundhog backends flatten
tree of embedded datatypes to db columns.
* Projections. You can choose what columns to query from a table in a
type-safe manner.
* Initialization and migration of database schema.
* Sum types and polymorphic types.
* Expression DSL for use in queries.
* Basic list support.
* YAML-based settings mechanism. It separates datatype definition and
description which facilitates modularity. The settings are inferred
from the analysis of the difinition, and overridden with values set by
user.
The Criterion benchmarks are available at
http://lykahb.github.com/groundhog/SqliteBench.html and
http://lykahb.github.com/groundhog/PostgreSQLBench.html.
Future plans:
* Support for joins
* Database indexes
* Investigate options for implementing MongoDB and MySQL backends
Your feedback, suggestions for improvement and criticism are welcome.
--
Regards,
Boris
2
2
ANN: Cumino 0.3 - Now supports sandboxed environments (e.g, Hsenv ones)
by Alfredo Di Napoli 14 Sep '12
by Alfredo Di Napoli 14 Sep '12
14 Sep '12
Hi CafĆØ,
I'm glat to annouce the third major improvement of my VIm plugin Cumino:
https://github.com/adinapoli/cumino
This one is a juicy one. If you have a sandboxed environment enabled (e.g.
one created with Hsenv) and you start vim from the same shell,
Cumino will automatically uses at startup the right ghci instance. This
means that if you have installed only some packages in your sandbox env,
you will have them available inside ghci :)
Feedback are welcome, as always.
A.
1
0
What is the good way to work with list comprehension and UTCTime?
by Magicloud Magiclouds 14 Sep '12
by Magicloud Magiclouds 14 Sep '12
14 Sep '12
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 idea?
--
竹åÆå²å¦Øęµę°“čæ
å±±é«åŖé»éäŗé£
And for G+, please use magiclouds#gmail.com.
3
3
[ANN] Cumino 0.2 - Now supports pretty indentation through stylish-haskell
by Alfredo Di Napoli 13 Sep '12
by Alfredo Di Napoli 13 Sep '12
13 Sep '12
Hi everyone,
in case you have missed it, I've released a Vim plugin called Cumino:
http://adinapoli.github.com/cumino/
It does one simple thing: It allows communication between Vim and tmux, in
particular to a ghci session. With Cumino you can fire-up Vim,
load a ghci session and interact with it with only few keystrokes. The
plugin also supports visual selection: you can select for example a
function (even with all its signature!)
and you can send it to ghci. The visual selection supports imports, custom
types and typeclasses.
It's a simple idea but so damn useful, imho.
This release also adds the possibility to prettify the code using the
excellent stylish-haskell: select a snippet, simply indent in the usual way
( = ) and voilĆ , now
your code is indented!
Feedback are highly appreciated, as well as contributions.
There are still some issues with some terminals (for example urxvt does not
work right now) but the plugin has been tested against gnome-terminal,
xterm and mlterm.
I'll post in reddit too for completeness!
Bye!
Alfredo
6
14
Is it just me or is Hackage indeed been going down more frequently of late?
Regards,
Kashyap
3
2