[Haskell] Announcement: Fast linear programming with comfort-glpk and coinor-clp

2023-05-14 Thread Henning Thielemann


I happily released two other numeric packages based on the comfort-array 
types. These are bindings to fast numeric linear programming solvers:

  https://hackage.haskell.org/package/comfort-glpk
  https://hackage.haskell.org/package/coinor-clp

The first one is (another) binding to GLPK and the second one is a binding 
to COIN-OR/CLP. I guess this is the first Haskell binding to COIN-OR/CLP, 
at all. I found that the COIN-OR solver is not as simply structured as 
GLPK and the examples miss the simple use cases, but its performance is 
much better than that of GLPK and its interior point solver 
(Method.initialBarrierSolve) just works, in contrast to the one of GLPK.


Warm start of solvers is supported by according monadic interfaces.

Both packages use the same types to describe linear programming problems, 
thus you can describe your problem once and then simply choose the 
appropriate solver. The types are exported by the package 
linear-programming.


The flexible array shapes provided by comfort-array help a lot to 
structure the problem variables. This saves you from the need to manually 
work with integer indices. You can concatenate array shapes with (::+) and 
establish Cartesian products with (,) and define array shapes that are 
compatible with nested tuples (e.g. Shape.NestedTuple ((X,X),(X,X,X))) or 
define arrays with indices of any Enum type (Shape.Enumeration).

___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


Re: [Haskell-cafe] Decorating exceptions with backtrace information

2020-05-12 Thread Henning Thielemann


On Fri, 8 May 2020, Ben Gamari wrote:


Henning Thielemann  writes:


We are talking about the HasCallStack stack traces, yes?
How is their emission addressed by extending exceptions with stack
traces?


HasCallStack stack traces are one type of backtrace that the proposal
supports. However, it's not the only (nor is it even the most useful
sort, in my opinion).

Other mechanisms include cost center stacks from the cost-center
profiler and native stack unwinding.



Interesting. That's a completely new thing.



* Developers cannot easily produce stack traces do debug unintended
exceptions.


What are "unintended exceptions"?
What is an example of an "unintended exception"?


For instance,

* Somewhere deep in my code a colleague used `fromJust` due to a
  miscommunicated invariant


That's a programming error.


* Somewhere in my system a `writeFile "tmp" $ repeat 'a'` failed due to
  filling the disk


Hm, that's also a programming error, but it ends in an IO exception. If it 
would not end in an IO exception (e.g. writing to /dev/null) it would go 
to an infinite loop. Anyway, it is a programming error. However it is an 
unchecked one. That is, there is no warranty that you can catch it by a 
debugger. So I do not think you can achieve much with callstacks here.



* Somewhere in my system I have a partial pattern match in a module
  which was compiled without -Wall


Programming error and btw. before thinking about a GHC extension I would 
enable -Wall ...



* Somewhere in my system I `div` by zero due to lack of input
  validation


Programming error


* I use a record selector on a sum.


Programming error


* A logic error results in an assertion failure deep in my program, but
  it's unclear which path my program took to arrive at the assertion


Sounds like Programming error



This list could go on and on...


From your list of examples I deduce that the proposal is about programming 
errors. But we have HasCallStack for that one. How does the proposal 
improve or alter the HasCallStack solution? And how does it relate to the 
IO exception system with hierarchical exceptions and SomeException and so 
on?




Currently the proposal does not cover asynchronous exceptions but it
wouldn't be particularly hard to extend it in this direction. This would
allow far better reporting of heap/stack overflows and MVar deadlocks
(which are particularly hard to debug at the moment).


Hm, what kind of heap or stack overflow are you thinking of?

A stack overflow sounds like unlimited recursion and thus like a 
programming error. In contrast to that, a program must be prepared for a 
failure of "malloc". Memory exhaustion is an IO exception, it should be 
explicit in the type.


Are MVar deadlocks always detected by the runtime system?
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: [Haskell-cafe] Decorating exceptions with backtrace information

2020-05-12 Thread Henning Thielemann


On Fri, 8 May 2020, Ben Gamari wrote:


We can debate whether partial functions like `fromJust` should exist; however,
the fact of the matter is that they do exist and they are used.


That's not my point. I say: fromJust on Nothing is a programming error, 
ok. We must debug this. HasCallStack helps here. However, it does not have 
to do with exceptions or with the proposals as I understand them.



Furthermore, even `base`'s own IO library (e.g. `openFile`) uses
synchronous exceptions to report errors.


Right. I say: Such exceptions are part of the public interface and should 
be expressed in types. If you encounter any problems when not doing this, 
I would first try to solve the problem with exceptions explicit in the 
type. E.g. Haddock for openFile says:


This operation may fail with:

* isAlreadyInUseError ...
* isDoesNotExistError ...
* isPermissionError ...

Thus the type should be:

openFile ::
   (AlreadyInUseException e,
DoesNotExistException e,
PermissionException e) =>
   FilePath -> IOMode -> ExceptT e IO Handle



Perhaps this helps to shed some light on the motivation?


Unfortunately no. I only see the immortal confusion about (programming) 
errors vs. (IO) exceptions. And I think that part of this confusion is 
that IO exceptions in 'base' are hidden in the IO type and that there are 
hybrid functions like 'throw' that can be called like 'error' but they 
cause IO exceptions that can be caught by 'catch'.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: [Haskell-cafe] Decorating exceptions with backtrace information

2020-05-12 Thread Henning Thielemann


On Fri, 8 May 2020, Niklas Hambüchen wrote:


What are "unintended exceptions"?
What is an example of an "unintended exception"?


A recent example from my production server:

   hPutBuf: resource vanished (Broken pipe)



Ok, I lookup the Haddock comment of hPutBuf and it says:

"This operation may fail with:

* ResourceVanished if the handle is a pipe or socket, and the reading end 
is closed."


That is, ResourceVanished is part of the public interface and in no way 
unexpected (or what "unintended" may be). I would prefer to make this 
explicit in the type of hPutBuf:


hPutBuf ::
   (ResourceVanishedException e) =>
   Handle -> Ptr a -> Int -> ExceptT e IO ()

Now, what do you intend to do with the call-stack? Isn't it something you 
can attach to the e value?___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: [Haskell-cafe] Decorating exceptions with backtrace information

2020-05-08 Thread Henning Thielemann


On Fri, 8 May 2020, Niklas Hambüchen wrote:


On 5/8/20 7:32 PM, Henning Thielemann wrote:


Can someone please give me examples where current state lacks


* Currently stack traces are not printed, so users cannot forward them 
to the developer, even if both the users and the developers would like 
that.


We are talking about the HasCallStack stack traces, yes?
How is their emission addressed by extending exceptions with stack traces?

* Developers cannot easily produce stack traces do debug unintended 
exceptions.


What are "unintended exceptions"?
What is an example of an "unintended exception"?___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: [Haskell-cafe] Decorating exceptions with backtrace information

2020-05-08 Thread Henning Thielemann


On Fri, 8 May 2020, Niklas Hambüchen wrote:


On 5/8/20 5:37 PM, Henning Thielemann wrote:


a callstack is not useful for a user.


Call stacks have been very useful to me as a user of non-Haskell tools 
so far, because they are excellent for attaching to bug reports and 
usually led to developers fixing my problems faster.


This confirms that they are not for you, but you only forward them to the 
developer.



Can someone please give me examples where current state lacks and how they 
are addressed by the proposal(s)?___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: [Haskell-cafe] Decorating exceptions with backtrace information

2020-05-08 Thread Henning Thielemann


There seem to be multiple beginnings of the discussion. What is currently 
discussed?


If someone says "exceptions" and "backtrace" in one sentence, I suspect 
like many times before, that again confusion of the concepts of exceptions 
and errors is ahead. Errors already support call stacks. Why should 
exceptions get them, too? Exceptions should carry information that is 
useful for a user, but a callstack is not useful for a user.


I can imagine that it would be helpful for the user to get a stacked 
exception information like:

   Parse error on line 42, column 23
   while reading file "foo/bar"
   while traversing directory "blabla"

But since you refer to the CallStack feature of GHC, this seems not to be 
addressed in the proposals.




On Fri, 8 May 2020, Carter Schonwald wrote:

I have no doubt such a mechanism would have saved me many hours of 
debugging exceptions in Haskell systems I've worked on in the past.


If you must debug exceptions, then this sounds like exceptions were abused 
for programming errors.




Ben writes in:
   http://www.well-typed.com/blog/2020/04/dwarf-3/

"Unfortunately, the untyped nature of Haskell exceptions complicates the 
migration path for existing code."


Actually, it only proves again, that it was wrong from the beginning to 
hide information about potential exceptions in the IO monad instead of 
making them explicit via ExceptionalT, ExceptT or the like.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


[Haskell] Announce: comfort-array, lapack

2019-05-25 Thread Henning Thielemann


I like two announce two of my packages:

1. comfort-array
http://hackage.haskell.org/package/comfort-array

It provides Boxed and Storable arrays with very liberal shape definitions. 
You may use ranges of indices like in 'array' or zero-based indexing like 
in 'repa', but you can also use arbitrary index Sets, enumerations, 
concatenation of arrays and more. E.g. an array with (Shape.Enumeration 
Ordering) has three elements with indices LT, EQ, GT.


2. lapack
http://hackage.haskell.org/package/lapack

A high-level interface to the numerical Linear Algebra package LAPACK. It 
is based on comfort-array, which means that a vector can have a rich 
structure. E.g. matrix vector multiplication has the signature:

   (#*|) :: Matrix.General height width a -> Vector width a -> Vector height a

Thus, a 'Matrix.General (Shape.Enumeration Ordering) (h,w) a' would map a 
rectangular array with dimensions h and w to a three-element vector with 
indices LT, EQ, GT.


The LAPACK interface provides solvers for simultaneous linear equations, 
linear least-squares problems, eigenvalue and singular value problems for 
square, triangular, symmetric, Hermitian, banded and banded Hermitian 
matrices, as LAPACK supports them.



For a motivating example refer to:
   http://code.henning-thielemann.de/bob2019/main.pdf
___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


[Haskell] GHC 8.4.1 released

2018-03-15 Thread Henning Thielemann


So far only announced on Haskell-Cafe, but not the Haskell mailing list:
   http://mail.haskell.org/haskell-cafe/2018-March/128730.html
___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


Re: TDNR without new operators or syntax changes

2016-05-22 Thread Henning Thielemann


On Sun, 22 May 2016, Jeremy . wrote:


1. If the compiler encounters a term f a, and there is more than one definition 
for f in scope (after following all of
the usual rules for qualified imports);

2. And exactly one of these definitions matches the type of a (or the expected 
type of f if given);

3. Then this is the definition to use.



I know people are unhappy with Haskell's records and module system, but I 
still think that's because these language features are not used properly. 
Type classes are the tool to write generic code and reduce combinatoric 
explosion of functions and modules are a way to collect functions per 
type. Following this principle you give function names that make sense 
together with the module name like File.write or Channel.write. Then there 
is no need for the compiler to disambiguate unqualified identifiers and 
you keep the type and the module issues separated.


Today, if you stick to the unqualified style, and I guess you want to 
import modules without explicit identifier list, too, then your code can 
break whenever the imported modules add identifiers. In order to prevent 
this you have to use tight package import version bounds in your Cabal 
file. Your proposal would not solve this problem. Type-driven name 
resolution may disambiguate identifiers in some case but not in all ones, 
thus you still need to use tight version bounds.


The proposal seems to be a big complication. The compiler can no longer 
emit a message: "Type of function f mismatch", but it has to emit "If f 
means A.f, then the type error would be ..., but if it means B.f, then the 
type error would be ..." Or even worse: "If f means A.f and g means C.g, 
then the type error would be ... if f means B.f and g means C.g ... or f 
means A.f and g means D.g ..." The proposal also is more error-prone, 
because if you make a type-error this could be shadowed by a function in 
scope with a type that matches accidentally. A function with a very 
generic type and a generic name might be such an accidental match.


That said, the more complicated the proposals become the more one should 
reconsider about whether one runs in the right direction. I think this is 
the case here. The simple answer could be: Switch to a cleaner coding 
style!___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Warn about unwanted instances in a modular way

2016-03-23 Thread Henning Thielemann


I like to propose the following way to warn about instances that are 
unwanted by some programmers. First step is to mark the instances at their 
definition site like so:


{-# WARN_INSTANCE tuple #-}
instance Foldable ((,) a) where ...

{-# WARN_INSTANCE tuple #-}
instance Functor ((,) a) where ...

{-# WARN_INSTANCE tuple #-}
instance Foldable ((,,) a b) where ...

{-# WARN_INSTANCE tuple #-}
instance Functor ((,,) a b) where ...


This way, all the above instances are collected in an instance group 
labelled 'tuple'. At the use sites we introduce a GHC warning option like 
-fwarn-instance=tuple. This warns about any place where any of the 'tuple' 
instances is used. We can either place


   GHC-Options: -fwarn-instance=tuple

in a Cabal package description in order to issue warnings in a whole 
package or we can put


   {-# OPTIONS_GHC -fwarn-instance=tuple #-}

at the top of a module in order to enable the warning per module.

Another candidate for an instance group might be 'numeric' for numeric 
instances of functions and tuples in the NumInstances package.


What does it mean to use an instance? I would say, if omitting an instance 
X Y would lead to a "missing instance" type error at place Z in a module, 
then instance X Y is used at place Z.


There might be an even more restrictive option like:
   -fforbid-instance=tuple

This would not only warn about an instance usage, but it would cause a 
type error. Essentially it should treat all 'tuple' instances as if they 
were not defined. (Other instances might depend on 'tuple' instances and 
if the 'tuple' instances weren't there the compiler would not even reach 
the current module. I do not know, whether this case needs special 
treatment. We might require that any instance depending on 'tuple' must be 
added to the 'tuple' group as well or it might be added automatically.)
 The advantage of a type error is that we see all problems from 'tuple' 
instances also in the presence of other type errors. Warnings would only 
show up after a module is otherwise type correct.


This solution requires cooperation of the instance implementor. Would that 
work in practice? Otherwise we must think about ways to declare instance 
groups independently from the instance declaration and we get the problem 
of bringing the instance group names into the scope of the importing 
module.


A separate discussion must be held on whether -fwarn-instance=tuple should 
be part of -Wall. I think that people should be warned about 'tuple' 
instances early because they won't expect that there is a trap when using 
'length' and 'maximum' and so on.


One might also think about generalizations, e.g. whether

   {-# WARN_INSTANCE tuple, functor #-}

should be allowed in order to put an instance in several groups or whether 
there should be a way to compose a group from subgroups.


Another topic would be a form of instance group disambiguation. Instance 
groups might be qualified with module or package names. I think package 
names are more appropriate, like so:

   -fwarn-instance=base:tuple
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: suppress warning "Defined but not used: type variable ‘x’" in GHC-8.0

2016-01-11 Thread Henning Thielemann


On Mon, 11 Jan 2016, Richard Eisenberg wrote:


On Jan 9, 2016, at 6:44 PM, Henning Thielemann <lemm...@henning-thielemann.de> 
wrote:


instance (Natural n) => Num.Integer (Un n) where
   type Repr (Un _n) = Unary


GHC-7.6.3 and GHC-7.4.2 complain:
   Type indexes must match class instance head
   Found `Un _n' but expected `Un n'
   In the type synonym instance declaration for `Num.Repr'
   In the instance declaration for `Num.Integer (Un n)'


GHC-7.8.4, GHC-7.10.3 and GHC-8.0 are happy with the difference.


I'm surprised this is accepted at all. Looks like hogwash to me. I think you 
should post a bug report.


Ok, but then GHC must not warn about the unused argument of Repr.
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


suppress warning "Defined but not used: type variable ‘x’" in GHC-8.0

2016-01-09 Thread Henning Thielemann


GHC-8.0 emits several new warnings of this kind:

   Defined but not used: type variable ‘x’

for declarations like

   type instance Snd x y = y

Enthusiastically, I started to replace unused type function arguments by 
underscores, only to find out that older GHC versions do not accept that. 
With what option can I disable this warning? Or can it be removed from 
-Wall for now?___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: suppress warning "Defined but not used: type variable ‘x’" in GHC-8.0

2016-01-09 Thread Henning Thielemann


On Sat, 9 Jan 2016, Carter Schonwald wrote:


Have you tried _x instead?


Ah, this solves the problem! Almost.

I have an instance like this one:

instance (Natural n) => Num.Integer (Un n) where
type Repr (Un _n) = Unary


GHC-7.6.3 and GHC-7.4.2 complain:
Type indexes must match class instance head
Found `Un _n' but expected `Un n'
In the type synonym instance declaration for `Num.Repr'
In the instance declaration for `Num.Integer (Un n)'


GHC-7.8.4, GHC-7.10.3 and GHC-8.0 are happy with the difference.
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: Optimization of IORefs and STRefs - comparison to g++

2016-01-09 Thread Henning Thielemann


How about just using alloca, peek and poke - like C guys do in order to 
get C's speed?

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: [Haskell] [Haskell-beginners] DOOM rewritten in the Haskell programming language.

2015-12-07 Thread Henning Thielemann


On Mon, 7 Dec 2015, Patrick Redmond wrote:


I'd also like to show support and participate in building this out if work is 
needed. Contact me when/if that happens!


haskell@haskell.org is an announcement list. Please continue discussion in 
haskell-cafe etc.

___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


Re: [Haskell-cafe] record field names vs. -fwarn-unused-binds

2015-11-04 Thread Henning Thielemann


On Tue, 3 Nov 2015, Evan Laforge wrote:

I can work around by putting underscores on field names I haven't used 
yet, but it's a hassle to go edit them when I want to use them.


I do it this way and I do not consider it a work-around. The underscore is 
just the shortest way to say that a record field name is not used. It's 
shorter than any pragma could be.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users


Re: [Haskell] There has been discussion on matrix operations and cache thrashing; does management think using Haskell would lead to cash thrashing?

2015-03-16 Thread Henning Thielemann


On Mon, 16 Mar 2015, KC wrote:



There has been discussion on matrix operations and cache thrashing; does 
management think using Haskell would
lead to cash thrashing?

What could change management's mind?


Unfortunately I don't understand the question, but in any case I think 
that better fits to haskell-c...@haskell.org than haskell@haskell.org

___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


Re: [Haskell] Constraint Satisfaction Problem

2015-03-04 Thread Henning Thielemann


On Wed, 4 Mar 2015, K Sai Anirudh wrote:


Hello,

I tried to solve simple constraint satisfaction problem. This is my code  
http://pastebin.com/VAaRYSEA ; .
This gives solution for present list of domains, but when I change the domain 
of 'd' in the list 'ld' then I
get error. I think the error is in line 52. I indexed the first value, but I 
tried filtering the results
where all the variables are assigned and I get error.


I think this fits better to

   Haskell Cafe haskell-c...@haskell.org

where I send this reply, too.___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


Re: [Haskell] Rank-N types with (.) composition

2015-02-11 Thread Henning Thielemann


On Tue, 10 Feb 2015, Tyson Whitehead wrote:

I came across something that seems a bit strange to me.  Here is a 
simplified version (the original was trying to move from a lens 
ReifiedFold to a lens-action ReifiedMonadicFold)


You are on Haskell@haskell.org here. Could you please move to 
haskell-cafe?

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] ANN: patch-image

2014-09-15 Thread Henning Thielemann
Right after the announcement of the latest version of Accelerate I like 
to announce an application build using that framework:


patch-image assembles a big image from several overlapping parts.

http://hackage.haskell.org/package/patch-image


Now, let me extract the beginning of the docs:

  Compose a collage from overlapping image parts.
  In contrast to Hugin,
  this is not intended for creating panoramas from multiple photographies,
  but instead is specialised to creating highly accurate reconstructions
  of flat but big image sources, like record covers, posters or newspapers.
  It solves the problem that your scanner may be too small
  to capture a certain image as a whole.
  .
  This is the workflow:
  Scan parts of an image that considerably overlap.
  They must all be approximately oriented correctly.
  The program uses the overlapping areas for reconstruction
  of the layout of the parts.
  If all parts are in the directory @part@
  then in the best case you can simply run:
  .
   patch-image --output=collage.jpeg part/*.jpeg
  .
  If you get blurred areas,
  you might enable an additional rotation correction:
  .
   patch-image --finetune-rotate --output=collage.jpeg part/*.jpeg


Currently it depends on CUDA although this is not strictly necessary.
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[haskell art] HaL-9 registration open

2014-05-19 Thread Henning Thielemann
A message for German Haskell users follows:



HaL ist ein lokaler Haskell-Workshop mit überregionaler Bedeutung, der
nun bereits das 9. Mal stattfindet. Dieses Jahr laden wir für den 20.
Juni ins Institut für Informatik an der Martin-Luther-Universität
Halle-Wittenberg ein.

Das Programm für HaL-9 kann man herunterladen von:
http://code.haskell.org/hal/09-2014/druck/programm.pdf

Es wird noch kleinere Änderungen und Erweiterungen geben. Das endgültige 
Programm werden wir beim Empfang austeilen.

Anmelden kann man sich unter:
http://sim.mathematik.uni-halle.de:8080/hal9/

Anmeldeschluss ist 2014-06-11. Frühes Anmelden sichert Plätze in den 
beliebtesten Tutorien!


Viele Grüße
Henning Thielemann

-- 

Read the whole topic here: Haskell Art:
http://lurk.org/r/topic/6sT8bnDabQ3yRxF8plXb9z

To leave Haskell Art, email haskell-...@group.lurk.org with the following email 
subject: unsubscribe


[Haskell] HaL-9 registration open

2014-05-19 Thread Henning Thielemann

A message for German Haskell users follows:



HaL ist ein lokaler Haskell-Workshop mit überregionaler Bedeutung, der
nun bereits das 9. Mal stattfindet. Dieses Jahr laden wir für den 20.
Juni ins Institut für Informatik an der Martin-Luther-Universität
Halle-Wittenberg ein.

Das Programm für HaL-9 kann man herunterladen von:
   http://code.haskell.org/hal/09-2014/druck/programm.pdf

Es wird noch kleinere Änderungen und Erweiterungen geben. Das endgültige 
Programm werden wir beim Empfang austeilen.


Anmelden kann man sich unter:
   http://sim.mathematik.uni-halle.de:8080/hal9/

Anmeldeschluss ist 2014-06-11. Frühes Anmelden sichert Plätze in den 
beliebtesten Tutorien!



Viele Grüße
Henning Thielemann
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] Automated YouTube uploads

2014-05-13 Thread Henning Thielemann
In case I did not announce it before - I wrote a set of two small 
programs that upload videos to YouTube. It is useful in two situations:


1. Upload a list of videos with metadata fetched from a spreadsheet.
2. Upload from a remote machine without a graphical browser.

http://hackage.haskell.org/package/youtube

You need 'curl' to be installed and you need to register for a YouTube 
developer key.

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: can't load .so/.DLL - undefined symbol

2014-04-11 Thread Henning Thielemann

Am 17.03.2014 15:33, schrieb Henning Thielemann:

Am 17.03.2014 10:22, schrieb Simon Marlow:

package.  Perhaps you have a copy of that module on the search path
somewhere, or inside the alsa-seq package?


This would confirm how I understood the linker message. Then I guess
that compiling all packages at once in a single build dir with cabal was
the problem. The command line was like:

$ cabal install --builddir=/tmp/dist --with-ghc=ghc7.8.0.20140228 poll
alsa-seq pkg1 pkg2 pkg3 ...

After compiling the packages separately the problem has gone.


I think I know what the problem was: 'poll' uses HSC as preprocessor, 
thus preprocessed files were stored in dist. This way the preprocessed 
source files were available to GHC when compiling 'alsa' and thus it was 
compiled again, but not registered in the 'alsa' package.


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


[Haskell] HaL-9 - Call for Contributions

2014-03-24 Thread Henning Thielemann
HaL ist ein lokaler Haskell-Workshop mit überregionaler Bedeutung, der 
nun bereits das 9. Mal stattfindet. Dieses Jahr laden wir für den 20. 
Juni ins Institut für Informatik an der Martin-Luther-Universität 
Halle-Wittenberg ein.


Wir suchen Beiträge zu Haskell im Besonderen und der funktionalen 
Programmierung im Allgemeinen, aber auch Anknüpfungen an andere 
Programmierparadigmen.


Dabei interessieren wir uns unter anderem für die Themenbereiche

* Neues von Sprache, Bibliotheken, Werkzeugen,
* Anwendungen von Kunst bis Industrie,
* Lehre und Forschung an Schulen und Hochschulen.

Die Beiträge können präsentiert werden als

* Tutorium (etwa 90 min)
* Vortrag (etwa 30 min)
* Demonstration, künstlerische Aufführung

Die Veranstaltungssprache ist Deutsch, nach Absprache auch Englisch. 
Presentations will be given in German but we can switch to English if 
requested.


Bitte reichen Sie Kurzfassungen der Beiträge ein (max. 3 Seiten), die 
dem Programmkomitee eine Einschätzung ermöglichen, sowie eine knappe 
Zusammenfassung von etwa 100 Wörtern.


Teilnehmer des Workshops sind Interessenten (keine Erfahrung mit Haskell 
oder funktionaler Programmierung), Anfänger (wenig Erfahrung) und 
Experten. Wir bitten die Vortragenden, die Zielgruppe des Beitrags 
anzugeben und die nötigen Vorkenntnisse zu beschreiben. Bei Tutorien 
sollen Teilnehmer auf eigenen Rechnern arbeiten. Bitte beschreiben Sie 
dazu die vorher zu installierende Software.


Senden Sie die Beitragsvorschläge als PDF-Dokument bis zum

 27. April 2014

an
 hal-commit...@iba-cg.de

Wir werden Ihnen bis zum 9. Mai mitteilen, ob wir Ihren Beitrag in das 
Programm aufnehmen.



Für das Organisationsteam
Henning Thielemann
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: positive type-level naturals

2014-03-19 Thread Henning Thielemann

Hi Iavor,


Am 19.03.2014 22:27, schrieb Iavor Diatchki:


I see two separate issues that show in what you describe, so it might be
useful to discuss them separately:


Thank you and Richard Eisenberg for the detailed explanations. For now, 
I have just fooled GHC by unsafeCoerceing dictionaries as suggested by 
Richard.



A general comment:  the function `withVec` is fairly tricky because it
introduces vectors whose length is not known statically.  This tends to
require much more advanced tools because one has to do real mathematical
reasoning about abstract values.  Of course, sometimes there is no way
around this, but on occasion one can avoid it.   For example, in the
expression `withVec 1 [2,3,4]` we know exactly the length of the vectors
involved, so there is no reason to resort to using fancy reasoning.  The
problem is that Haskell's list notation does not tell us the length of
the list literal.  One could imagine writing a little quasi-quoter that
will allow us to write things like `[vec| 1, 2, 3, 4]`, which would
generate the correctly sized vector. Then you can append and manipulate
these as usual and GHC will be able to check the types because it only
has to work with concrete numbers.  This is not a great program
verification technique, but it certainly beats having to do it manually :-)


For this problem I have a simple solution. I think that the infix list 
syntax is underrated. If you are used to write 1:2:3:4:[], then you have 
no problem writing:


  x = 1:.2:.3:.4:.End

with

  data OneMore f a = a :. f a
  data End a = End

Then x has type (OneMore (OneMore (OneMore (OneMore End))) a) and GHC 
can easily derive the static list length from it.


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: can't load .so/.DLL - undefined symbol

2014-03-17 Thread Henning Thielemann

Am 17.03.2014 10:22, schrieb Simon Marlow:

On 11/03/2014 22:11, Henning Thielemann wrote:

I am trying to understand the following linker message. I have started
GHCi, loaded a program and try to run it:

Main main
...
Loading package poll-0.0 ... linking ... done.
Loading package alsa-seq-0.6.0.3 ... can't load .so/.DLL for:
/var/cabal/lib/x86_64-linux-ghc-7.8.0.20140228/alsa-seq-0.6.0.3/libHSalsa-seq-0.6.0.3-ghc7.8.0.20140228.so

(/var/cabal/lib/x86_64-linux-ghc-7.8.0.20140228/alsa-seq-0.6.0.3/libHSalsa-seq-0.6.0.3-ghc7.8.0.20140228.so:

undefined symbol:
alsazmseqzm0zi6zi0zi3_SystemziPosixziPoll_zdfStorableFd_closure)


I assume that GHCi wants to say the following: The instance Storable Fd
defined in module System.Posix.Poll cannot be found in the shared object
file of the alsa-seq package. That's certainly true because that module
is in the package 'poll' and not in 'alsa-seq'. But 'alsa-seq' imports
'poll'. What might be the problem?


It seems to have the idea that System.Posix.Poll is part of the alsa-seq
package.  Perhaps you have a copy of that module on the search path
somewhere, or inside the alsa-seq package?


This would confirm how I understood the linker message. Then I guess 
that compiling all packages at once in a single build dir with cabal was 
the problem. The command line was like:


$ cabal install --builddir=/tmp/dist --with-ghc=ghc7.8.0.20140228 poll 
alsa-seq pkg1 pkg2 pkg3 ...


After compiling the packages separately the problem has gone.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


type-level induction on Nat

2014-03-16 Thread Henning Thielemann

Am 16.03.2014 09:40, schrieb Christiaan Baaij:


To answer the second question (under the assumption that you want
phantom-type style Vectors and not GADT-style):


That works, someNatVal was the missing piece.


Now the natural next question is how to perform type-level induction on 
Nat. This page mentions the Nat1 type, a unary representation of natural 
numbers:

  https://ghc.haskell.org/trac/ghc/wiki/TypeNats/MatchingOnNats

Since the unary natural number kind so ubiquituous in examples, is there 
a recommended module to import it from, which also contains the 
injectivity magic of FromNat1? I cannot see it in:


http://hackage.haskell.org/package/base-4.7.0.0/candidate/docs/GHC-TypeLits.html

although it seems to have been there:
  http://co-dan.github.io/base-docs/src/GHC-TypeLits.html

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: type-level induction on Nat

2014-03-16 Thread Henning Thielemann

Am 16.03.2014 11:29, schrieb Henning Thielemann:


Since the unary natural number kind so ubiquituous in examples, is there
a recommended module to import it from, which also contains the
injectivity magic of FromNat1? I cannot see it in:

http://hackage.haskell.org/package/base-4.7.0.0/candidate/docs/GHC-TypeLits.html


although it seems to have been there:
   http://co-dan.github.io/base-docs/src/GHC-TypeLits.html


Nat1 was removed here:

https://github.com/ghc/packages-base/commit/5eaba365ff2354d3231f049866964d25f245ede2

but commit message does not tell where it was moved. :-( Obviously it 
was not moved to singletons.


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


positive type-level naturals

2014-03-16 Thread Henning Thielemann

Am 16.03.2014 09:40, schrieb Christiaan Baaij:


To answer the second question (under the assumption that you want
phantom-type style Vectors and not GADT-style):


Now I like to define non-empty vectors. The phantom parameter for the 
length shall refer to the actual vector length, not to length-1, for 
consistency between possibly empty and non-empty vectors.


I have modified your code as follows:

{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
module PositiveNat where

import Data.Proxy (Proxy(Proxy))
import GHC.TypeLits
  (Nat, SomeNat(SomeNat), KnownNat, someNatVal, natVal,
   type (=), type (+))

data Vector (n :: Nat) a = Vector a [a]

withVector ::
   forall a b.
   a - [a] -
   (forall n . (KnownNat n, 1=n) = Vector n a - b) - b
withVector x xs f =
   case someNatVal $ toInteger $ length xs of
  Nothing - error static/dynamic mismatch
  Just (SomeNat (_ :: Proxy m)) - f (Vector x xs :: Vector (m+1) a)

vecLen :: forall n . KnownNat n = Vector n Integer - Integer
vecLen _ = natVal (Proxy :: Proxy n)

--  withVector vecLen [1,2,3,4]
-- 4


GHC-7.8 complains with:

PositiveNat.hs:23:40:
Could not deduce ((1 GHC.TypeLits.=? (n + 1)) ~ 'True)
from the context (KnownNat n)
  bound by a pattern with constructor
 SomeNat :: forall (n :: Nat). KnownNat n = Proxy n - 
SomeNat,

   in a case alternative
  at PositiveNat.hs:23:13-34
In the expression: f (Vector x xs :: Vector (m + 1) a)
In a case alternative:
Just (SomeNat (_ :: Proxy m))
  - f (Vector x xs :: Vector (m + 1) a)
In the expression:
  case someNatVal $ toInteger $ length xs of {
Nothing - error static/dynamic mismatch
Just (SomeNat (_ :: Proxy m))
  - f (Vector x xs :: Vector (m + 1) a) }


How can I convince GHC that n+1 is always at least 1?


When I remove the (1=n) constraint, I still get:

PositiveNat.hs:23:40:
Could not deduce (KnownNat (n + 1)) arising from a use of ‘f’
from the context (KnownNat n)
  bound by a pattern with constructor
 SomeNat :: forall (n :: Nat). KnownNat n = Proxy n - 
SomeNat,

   in a case alternative
  at PositiveNat.hs:23:13-34
In the expression: f (Vector x xs :: Vector (m + 1) a)
In a case alternative:
Just (SomeNat (_ :: Proxy m))
  - f (Vector x xs :: Vector (m + 1) a)
In the expression:
  case someNatVal (toInteger (length xs)) of {
Nothing - error static/dynamic mismatch
Just (SomeNat (_ :: Proxy m))
  - f (Vector x xs :: Vector (m + 1) a) }

That is, I also have to convince GHC, that if (KnownNat n) then (n+1) is 
also KnownNat. How to do that?


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: positive type-level naturals

2014-03-16 Thread Henning Thielemann

Am 16.03.2014 13:48, schrieb Dan Frumin:

This is just a wild guess, but is there a possibility that (1+n) will
produce less complaints than (n+1)?


unfortunately no

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: positive type-level naturals

2014-03-16 Thread Henning Thielemann

Am 16.03.2014 14:35, schrieb Carter Schonwald:


You can't with type lits. The solver can only decide concrete values :(


I hoped that with type-level natural numbers all my dreams would become 
true. :-)


I'd be also happy if I could manually provide the proof for 1=n+1 and 
more complicated statements like n+n=2*n and n0  m0 = n*m0.



You'll have to use a concrete peano Nats type instead.


That is, I may as well stay with the existing type-level number packages?


I've been toying with the idea that the type lits syntax should be just
that, a type level analogue of from integer that you can give to user
land types, but I'm not going to suggest that till 7.8 is fully released.


Seems reasonable. By the way, is the GHC Nat kind defined by data 
promotion or is it a special kind with an efficient internal representation?


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: positive type-level naturals

2014-03-16 Thread Henning Thielemann

Am 16.03.2014 20:02, schrieb Carter Schonwald:

respectfully,
The current typeLits story for nats is kinda a fuster cluck to put it
politely . We have type lits but we cant use them (well, we can't
compute on them, which is the same thing).

For the past 2 years, every ghc release cycle, I first discover, then
have to communicate to everyone else you can't compute on type lits.


A minimal invasive solution would be to provide a kind for unary type 
level numbers and type functions that convert between Unary and Nat.


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


importing (=) from GHC.TypeLits

2014-03-15 Thread Henning Thielemann

I want to import Nat and type-level (=) from GHC.TypeLits:

  import GHC.TypeLits (Nat, (=))

Nat is found this way, but (=) is not:

  Module ‘GHC.TypeLits’ does not export ‘(=)’

What is the trick?

The doc only shows the anonymous import:

http://www.haskell.org/ghc/docs/7.8.1-rc2/html/users_guide/promotion.html
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


converting type-level natural numbers to data-level

2014-03-15 Thread Henning Thielemann

Am 15.03.2014 18:13, schrieb adam vogt:

http://www.haskell.org/ghc/docs/7.8.1-rc2/html/users_guide/syntax-extns.html#explicit-namespaces
is the trick


Great, this works!

Now I run into the next problem: How can I convert a type-level natural 
number into a data-level number? The Trac-Wiki mentions singletons:

  https://ghc.haskell.org/trac/ghc/wiki/TypeNats/Basics
and the base package of GHC-7.6 exports the Sing class:
  http://hackage.haskell.org/package/base-4.6.0.1/docs/GHC-TypeLits.html
but it seems to have gone in GHC-7.8. :-(

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


converting data-level natural numbers to type-level

2014-03-15 Thread Henning Thielemann

Am 15.03.2014 19:17, schrieb Erik Hesselink:


I think most of the singletons stuff has been moved to the
'singletons' package [0].


Yes, that's it. It means that all Nat related functionality in 
'singletons' can be implemented using GHC.TypeLits - interesting.


Using the library I succeeded to convert type-level Nats to data-level 
Integer. Now I need the other way round. I want to implement:


withVector ::
   [a] -
   (forall n. (KnownNat n) = Vector n a - b) -
   b

I want to have the (KnownNat n) constraint, since I want to call 'sing' 
within the continuation and this requires (KnownNat n). I guess, in 
order to implement withVector I need toSing, but this one does not give 
me a (KnownNat n). :-(


Thus I have two questions: What is the meaning of KnownNat and how can I 
implement withVector?


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


[Haskell] HaL-9 - regional Haskell meeting in Halle/Saale, Germany, 2014-06-20 - Save the date

2014-03-15 Thread Henning Thielemann

Save the date

for our local Haskell meeting in Halle/Saale, Germany,
presenting tutorials, talks, demonstrations ... everything you like.

Workshop language is German (mainly), and English (by request).

Switching to German:

-

Was: Haskell-Treffen HaL-9
Wann: Freitag, 2014-06-20
Wo: Institut für Informatik an der Martin-Luther-Universität
in Halle an der Saale

Der offizielle Aufruf zum Einreichen von Beiträgen folgt demnächst.


Mit besten Grüßen
Henning Thielemann
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


GHC-7.8 warning on rules that may not fire

2014-03-14 Thread Henning Thielemann

With GHC-7.8 I get lots of warnings like

src/Foo/Bar.hs:215:6: Warning:
Rule foo may never fire
  because ‘bar’ might inline first
Probable fix: add an INLINE[n] or NOINLINE[n] pragma on ‘bar’

So far I thought that rewrite RULES always have precedence to INLINE. 
Has this changed? I hesitate to follow the advice of adding phase 
numbers in bracket because I consider these phase numbers a quite 
fragile and non-modular solution (like precedence numbers for infix 
operators).


I have found:
   https://ghc.haskell.org/trac/ghc/wiki/Plugins/Phases

Is this still considered for future developments?
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: GHC-7.8 warning on rules that may not fire

2014-03-14 Thread Henning Thielemann

Am 14.03.2014 18:05, schrieb Simon Peyton Jones:


You may think they are fragile, but not as fragile as saying nothing and hoping 
for the best, which is *super*-fragile. You can't rely on rules to take 
priority, because the rule only fires if it matches, and it may only match if 
some other inlining has taken place.  (We tried that originally.)


Ok, how shall I choose n in INLINE[n]? Is there a meaning of the 
phase numbers? I guess it is important to adhere to some conventions in 
order to work together with other libraries.


If I understand correctly I can alter the number of phases with the 
-fsimplifier-phases option - how can I choose phase numbers for INLINE 
that are universally reasonable?


___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


can't load .so/.DLL - undefined symbol

2014-03-11 Thread Henning Thielemann
I am trying to understand the following linker message. I have started 
GHCi, loaded a program and try to run it:


Main main
...
Loading package poll-0.0 ... linking ... done.
Loading package alsa-seq-0.6.0.3 ... can't load .so/.DLL for: 
/var/cabal/lib/x86_64-linux-ghc-7.8.0.20140228/alsa-seq-0.6.0.3/libHSalsa-seq-0.6.0.3-ghc7.8.0.20140228.so 
(/var/cabal/lib/x86_64-linux-ghc-7.8.0.20140228/alsa-seq-0.6.0.3/libHSalsa-seq-0.6.0.3-ghc7.8.0.20140228.so: 
undefined symbol: 
alsazmseqzm0zi6zi0zi3_SystemziPosixziPoll_zdfStorableFd_closure)



I assume that GHCi wants to say the following: The instance Storable Fd 
defined in module System.Posix.Poll cannot be found in the shared object 
file of the alsa-seq package. That's certainly true because that module 
is in the package 'poll' and not in 'alsa-seq'. But 'alsa-seq' imports 
'poll'. What might be the problem?


It's a rather big example that fails here, whereas the small examples in 
alsa-seq package work. Thus I first like to know what the message really 
means, before investigating further. I installed many packages at once 
with cabal-install using a single build directory, like:


$ cabal install --builddir=/tmp/dist --with-ghc=ghc7.8.0.20140228 poll 
alsa-seq pkg1 pkg2 pkg3 ...


? Can this cause problems?
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


[Haskell] ANN: unicode-0.0

2014-01-04 Thread Henning Thielemann

The first announcement this year:

The 'unicode' package contains functions for construction of various 
characters like:


* block graphic elements

* frame elements

* fractions

* subscript and superscript characters

http://hackage.haskell.org/package/unicode

The package is simple Haskell 2010.


For example usage see the included 'visualize' example, buildable with 
'cabal install -fbuildExamples', and

   http://code.haskell.org/~thielema/set-cover/example/Domino.hs
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] Haskell can sing

2013-12-01 Thread Henning Thielemann


Hi all,

it's again Advent time and I took the opportunity to program another song 
for you. Those who liked last year's songs [1,2,3] may also be interested 
in the new one:

   http://www.youtube.com/watch?v=0EQCgi5qa3E   Alta trinita beata

It employs the great Haskell live sequencer and a new speech synthesizer 
that I developed with Haskell and LLVM. You find additional information in 
the video description.



Best,
Henning


[1] http://www.haskell.org/pipermail/haskell/2012-December/023591.html
[2] http://www.youtube.com/watch?v=-fmxHM69zgI
[3] http://www.youtube.com/watch?v=O5k0wUh0lj8
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell-cafe] Richard Bird and the fast nub function

2013-09-29 Thread Henning Thielemann


In Richard Bird's Functional Pearls in Algorithm Design there is chapter 
10 Removing duplicates which is about a fast and sorting variant of 
'nub'. After reading the introduction of the chapter I answered mentally 
Set.toAscList . Set.fromList - next chapter please. However after the 
introduction eight pages follow that develop an efficient algorithm for 
the problem. I suspected there might be the additional difficulty of not 
using the standard Set type, however on page 70 the common Set API is 
imported. In the final remarks of the chapter Bird writes: A nagging 
doubt remains that there might be a much simpler solution to such a simply 
stated problem. But so far I have not been able to find one. Now I am 
lost. Can someone tell me, how the task differs from what Set.toAscList . 
Set.fromList does?

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANN: Cabal v1.18.0 released

2013-09-16 Thread Henning Thielemann


On Wed, 4 Sep 2013, Johan Tibell wrote:


* GHCi support. It's now much easier to use ghci when developing your
packages, especially if those packages require preprocessors (e.g.
hsc2hs).


That's a great feature! How can I configure Cabal to start ghci with 
certain options? I like to enable more warnings. I could not find a 
documentation for the Cabal config file.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell] ANN: set-cover solves Sudoku, Soma cube, 8 Queens etc.

2013-09-04 Thread Henning Thielemann


I have prepared the package set-cover for solving exact set cover 
problems. It includes example programs for solving Sudoku, 8 Queens, Soma 
Cube, Tetris Cube, Cube of L's, and Logika's Baumeister puzzle. Please 
refer to these examples for learning how the library works.


The solver is generic with respect to the representation of sets. You may 
either use the high-level Set type from containers package or low-level 
bit vectors.


http://hackage.haskell.org/package/set-cover

The package is simple Haskell 2010.

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell-cafe] sequence causing stack overflow on pretty small lists

2013-08-28 Thread Henning Thielemann


On Tue, 27 Aug 2013, John Lato wrote:


[1] Most people are physically incapable of reading documents that explain why 
what they want to do won't
work.  Even if people did read the documentation, I suspect that the people 
most in need of the information
would be the least likely to understand how it applies to their situation.


Plus: I don't expect that programmers read the documentation of 'sequence' 
and 'mapM' again every time they use the function.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Extending Type Classes

2013-08-26 Thread Henning Thielemann


 The problem of refinement of type classes annoys me from time to time 
when I work on the NumericPrelude. It is an experimental type class 
hierarchy for mathematical types. Sometimes a new data type T shall be 
implemented and it turns out that you can implement only a part of all 
methods of a certain class. Then a natural step is to split the class into 
two classes A and B: 'A' contains the methods we can implement for T and 
'B' contains the remaining methods and 'B' is a sub-class of 'A'.
 First, this means that all client code has to be rewritten. Second, code 
for instances becomes very lengthy, because over the time code tends to 
contain one instances for every method. However the many small instances 
actually carry information: Every instance has its specialised 
constraints. E.g. you would certainly try to use only Applicative 
constraints in an Applicative instance and not Monad constraints. However, 
if there is a way to define Applicative and Monad instances in one go, the 
Applicative instance may get Monad constraints.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] GHC and backwards compatibility

2013-08-21 Thread Henning Thielemann

If you use

$ cabal install --constraint=array installed

then cabal-install is forced to use the installed version of array. If a 
package conflicts with this version, then it will report the conflicting 
packages.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Renumbered mailing list posts

2013-08-11 Thread Henning Thielemann

Am 10.08.2013 21:48, schrieb Austin Seipp:

Henning,

Thanks for the report. I'm currently investigating this, and think it
should be possible to keep all of the old URLs intact.


Thank you! This would be really really great!


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Renumbered mailing list posts

2013-08-10 Thread Henning Thielemann
Recently I found that links from Google search results to archive 
Haskell-Cafe messages are invalid. The messages are still there, but got 
a different number. E.g. the search result says:

  http://www.haskell.org/pipermail/haskell-cafe/2011-February/089455.html

But the message is at
  http://www.haskell.org/pipermail/haskell-cafe/2011-February/088146.html

Also links from Haskell-Wiki articles to the Haskell-Cafe archive are 
invalid now. This is very very very bad, since I used tons of such URLs 
in Wiki articles and it is very hard to find the message I referred to, 
if the URL does not work anymore.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANN: Monad.Reader Issue 22

2013-08-08 Thread Henning Thielemann


On Wed, 7 Aug 2013, Edward Z. Yang wrote:


I am pleased to announce that Issue 22 of the Monad Reader is now available.

   http://themonadreader.files.wordpress.com/2013/08/issue22.pdf

Issue 22 consists of the following two articles:

 * Generalized Algebraic Data Types in Haskell by Anton Dergunov
 * Error Reporting Parsers: a Monad Transformer Approach by Matt Fenwick and 
Jay Vyas
 * Two Monoids for Approximating NP-Complete Problems by Mike Izbicki


That is, there are three kinds of Haskellers: The ones who can count and 
the others who cannot. :-)


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] [ANN] Initial release of the threepenny-gui library, version 0.1.0.0

2013-07-21 Thread Henning Thielemann


On Sun, 21 Jul 2013, Sergey Mironov wrote:


Hi, I have a Path problem when installing threepenny-gui from Hackage.
Probably somtething trivial.


I have written a small script cabal-upload that tries to compile a package 
before uploading it to Hackage. That helps to assert that all required 
files are registered in the cabal file.


http://hackage.haskell.org/package/cabal-scripts

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


nightly builds: empty directory

2013-05-20 Thread Henning Thielemann


The page

   http://www.haskell.org/ghc/download

refers to directories for the nightly builds, that are actually empty:

   http://www.haskell.org/ghc/dist/current/dist/
   http://www.haskell.org/ghc/dist/stable/dist/

:-(

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: [Haskell] recursion patterns?

2013-05-15 Thread Henning Thielemann


On Wed, 15 May 2013, 7stud wrote:


Well, my question does not meet the standards for a question at stackoverflow:

(I am a haskell beginner)


Then you might want to post your question to haskell-beginners mailing 
list.


Is one solution more efficient than the other?  I believe my solution is 
tail recursive, but it's my understanding that compilers can now 
optimize just about anything into tail recursion.


The first solution works for infinite lists and the second one does not. 
It's really like foldr vs. foldl.


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell-cafe] meaning of referential transparency

2013-04-06 Thread Henning Thielemann


Can someone enlighten me about the origin of the term referential 
transparency? I can lookup the definition of referential transparency 
in the functional programming sense in the Haskell Wiki and I can lookup 
the meaning of reference and transparency in a dictionary, but I don't 
know why these words were chosen as name for this defined property.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] closed world instances, closed type families

2013-04-02 Thread Henning Thielemann


Recently I needed to define a class with a restricted set of instances. 
After some failed attempts I looked into the DataKinds extension and in 
Giving Haskell a Promotion I found the example of a new kind Nat for 
type level peano numbers. However the interesting part of a complete case 
analysis on type level peano numbers was only sketched in section 8.4 
Closed type families. Thus I tried again and finally found a solution 
that works with existing GHC extensions:


data Zero
data Succ n

class Nat n where
   switch ::
  f Zero -
  (forall m. Nat m = f (Succ m)) -
  f n

instance Nat Zero where
   switch x _ = x

instance Nat n = Nat (Succ n) where
   switch _ x = x


That's all. I do not need more methods in Nat, since I can express 
everything by the type case analysis provided by switch. I can implement 
any method on Nat types using a newtype around the method which 
instantiates the f. E.g.


newtype
   Append m a n =
  Append {runAppend :: Vec n a - Vec m a - Vec (Add n m) a}

type family Add n m :: *
type instance Add Zero m = m
type instance Add (Succ n) m = Succ (Add n m)

append :: Nat n = Vec n a - Vec m a - Vec (Add n m) a
append =
   runAppend $
   switch
  (Append $ \_empty x - x)
  (Append $ \x y -
  case decons x of
 (a,as) - cons a (append as y))


decons :: Vec (Succ n) a - (a, Vec n a)

cons :: a - Vec n a - Vec (Succ n) a



The technique reminds me on GADTless programming. Has it already a name?

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] closed world instances, closed type families

2013-04-02 Thread Henning Thielemann


On Tue, 2 Apr 2013, Daniel Peebles wrote:


It seems very similar to Ryan Ingram's post a few years back
(pre-TypeNats): 
http://www.haskell.org/pipermail/haskell-cafe/2009-June/062690.html
The main difference is that he introduces the knowledge about zero vs. suc as 
a constraint, and you introduce
it as a parameter. In fact, his induction function (which is probably what I'd 
call it too) is almost identical
to your switch.


The answer to his post by Miguel Mitrofanov contains a caseNat that is 
exactly my 'switch'. I see I am four years late.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Henning Thielemann


On Fri, 29 Mar 2013, Niklas Hambüchen wrote:


(This is a slightly detailed email. If you are the maintainer of one of
the packages benchmarked here, you might want to read it though.)


Could you please put your experiences the Wiki? This would help others to 
choose a package.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Henning Thielemann


On Fri, 29 Mar 2013, Louis Wasserman wrote:


Bearing in mind that I haven't looked at this in several years...
 Why did you switch from queuelike to pqueue?

Because I liked the API better?

 Could you put the code up somewhere manageable (repo)?

I had it up on darcs, but since that's not there any more, I don't have any 
more source history than you do.


Was it on code.haskell.org? Then it might have been moved to a non-web 
directory after the last attack 2011.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANN: psqueue-benchmarks - benchmarks of priority queue implementations

2013-03-29 Thread Henning Thielemann


On Fri, 29 Mar 2013, Niklas Hambüchen wrote:


On 29/03/13 20:14, Henning Thielemann wrote:

Was it on code.haskell.org? Then it might have been moved to a non-web
directory after the last attack 2011.


Does that mean the repo is still there without web access


I assume that.


or gone?


If the original author has not deleted it, then it should still be 
somewhere:


http://www.haskell.org/pipermail/haskell-cafe/2011-February/089352.html
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANN: monad-bool 0.1

2013-01-22 Thread Henning Thielemann


On Tue, 22 Jan 2013, John Wiegley wrote:


Use 'onlyIf' with AndM and AndMT to guard later statements, which are only
evaluated if every preceding 'onlyIf' evaluates to True.  For example:

   foo :: AndM Int
   foo = do onlyIf (True == True)
return 100
onlyIf (True == True)
return 150
onlyIf (True == False)
return 200

When run with `evalAndM foo (-1)` (where (-1) provides a default value), 'foo'
returns 150.


Does the And monad fulfill the monad laws? In a proper monad an interim 
(return x) (without a '-') is a no-op.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] Silent error

2013-01-20 Thread Henning Thielemann


On Mon, 21 Jan 2013, mip...@meta.ua wrote:


The program looks like this:

--***
factorial :: Int-Int
factorial n = product [1..n]

main = do
   print $ factorial 50
--***

And that yields 0 (no errors). Is it a bug or feature? :)


This question is certainly better posted to haskell-cafe.

The answer is: Int has limited bitsize (32 ord 64 bit depending on your 
machine), thus it computes factorial modulo 2^32 or 2^64. You can get the 
correct result by replacing Int by Integer.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell] Importing Repa library

2013-01-03 Thread Henning Thielemann


On Thu, 3 Jan 2013, Емануела Моллова wrote:


Hello! :)


I think you should better post your question to haskell-c...@haskell.org.


Then I put this script 

import qualified Data.Array.Repa as R
:m +Data.Array.Repa
Z

into the file file.hs,


This is GHCi syntax, but it is not a valid Haskell module as indicated by 
the .hs filename extension.



opened WinGHCi and loaded the file, and then evaluated it, but what I get is: 

Could not find module `Data.Array.Repa'
Perhaps you meant
Data.Array.Base (from array-0.4.0.0)
Data.Array.IO (from array-0.4.0.0)
Data.Array.ST (from array-0.4.0.0)
Use -v to see a list of the files searched for.
Failed, modules loaded: none.


I wonder why it loads file.hs at all. I would expect that it gives a 
syntax error.




Also ghc-pkg list repa says:

WARNING: cache is out of date: C:/Program Files/Haskell 
Platform/2012.4.0.0\lib\package.conf.d\package.cache
use 'ghc-pkg recache' to fix. C:/Program Files/Haskell 
Platform/2012.4.0.0\lib\package.conf.d:
C:\Users\Faery\AppData\Roaming\ghc\i386mingw32-7.4.2\package.conf.d:



Since 'repa' is not listed, it was not installed successfully. This would 
be consistent with the Could not find module message of GHCi. You may 
post the output of the 'cabal install repa' run.
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell-cafe] [Haskell] Importing Repa library

2013-01-03 Thread Henning Thielemann


On Thu, 3 Jan 2013, Емануела Моллова wrote:


Hello! :)


I think you should better post your question to haskell-cafe@haskell.org.


Then I put this script 

import qualified Data.Array.Repa as R
:m +Data.Array.Repa
Z

into the file file.hs,


This is GHCi syntax, but it is not a valid Haskell module as indicated by 
the .hs filename extension.



opened WinGHCi and loaded the file, and then evaluated it, but what I get is: 

Could not find module `Data.Array.Repa'
Perhaps you meant
Data.Array.Base (from array-0.4.0.0)
Data.Array.IO (from array-0.4.0.0)
Data.Array.ST (from array-0.4.0.0)
Use -v to see a list of the files searched for.
Failed, modules loaded: none.


I wonder why it loads file.hs at all. I would expect that it gives a 
syntax error.




Also ghc-pkg list repa says:

WARNING: cache is out of date: C:/Program Files/Haskell 
Platform/2012.4.0.0\lib\package.conf.d\package.cache
use 'ghc-pkg recache' to fix. C:/Program Files/Haskell 
Platform/2012.4.0.0\lib\package.conf.d:
C:\Users\Faery\AppData\Roaming\ghc\i386mingw32-7.4.2\package.conf.d:



Since 'repa' is not listed, it was not installed successfully. This would 
be consistent with the Could not find module message of GHCi. You may 
post the output of the 'cabal install repa' run.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell] Haskell from Glorious Kingdom

2012-12-04 Thread Henning Thielemann


Hi Haskellers,

since it is Advent time you might like to listen to a song that I programmed 
and performed with the Haskell Live-Sequencer [1]:


   http://www.youtube.com/watch?v=O5k0wUh0lj8

and you might want to check the Live-Sequencer, too. The Live-Sequencer allows 
to compose songs in Haskore style interactively. The most important feature is 
that you may alter the running program/song and that you can do so together 
with many people via network.



Best,
Henning


[1] http://www.haskell.org/haskellwiki/Live-Sequencer

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Status of Haskell'?

2012-11-30 Thread Henning Thielemann


On Sat, 1 Dec 2012, Gábor Lehel wrote:


On Fri, Nov 30, 2012 at 11:06 PM, Nate Soares n...@so8r.es wrote:


+1. I agree generally with Gabor's points -- GHC is in the drivers seat. But
at some point we should take a look at all the things GHC has made that did
pay off and that are good and make them official.

I'd very much like to see that endorsement happen soon, even if it's not
aggressive.


Well, I'm not so sure it's a great idea to just bake what GHC does at
this moment (for any particular extension) into the standard without
really thinking about it. Even then, you have to figure out, in great
detail, what GHC does, and write it all down! That's not negligible
effort, either. And the alternative is to also publicly discuss and
hash all of it out down to the little tiny gritty stuff. But wanting
to write a new standard (big effort!) just to get rid of some pragmas
and make people feel better (small payoff!) feels like a mismatch to
me.


In my opinion it is a good thing if people feel bad about a lot of 
LANGUAGE pragmas at top of their modules. For me the number of LANGUAGE 
pragmas is a (reciprocal) measure of how much effort the programmer 
invested in cleaning up the code. In the past I removed a lot of 
FlexibleInstances, FlexibleContexts, UndecidableInstances, 
TypeSynonymInstances, PatternGuards and _improved_ the code this way. The 
need for generalized instances is often caused by badly designed classes 
or types. For me many extensions are a way to get a working implementation 
quickly from which I can derive a simpler one by throwing out extensions 
successively. I would also like to tell students that if they need to 
enable language extensions (or specific set of extensions) then they are 
solving a task in a too complicated way.


I like to support Gábors arguments. We should have multiple 
implementations before standardization. E.g. I remember how TypeFamilies 
have evolved over the time or how the interaction of the forall quantifier 
with ($) changed between versions of GHC - how can we get confidence that 
GHC implemented these features in the most reasonable way?
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [haskell-llvm] fatal error with ghci and llvm

2012-11-23 Thread Henning Thielemann


On Fri, 23 Nov 2012, José Romildo Malaquias wrote:


When experimenting with the module LLVM.Core in GHCi on my gentoo linux
system, I have got a fatal error:


$ ghci
GHCi, version 7.6.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.

Prelude :m + LLVM.Core

Prelude LLVM.Core IntEQ
Loading package llvm-base-3.0.1.0 ...

GHCi runtime linker: fatal error: I found a duplicate definition for symbol
  LLVMAddAlwaysInlinerPass
whilst processing object file
  /usr/lib64/llvm/libLLVMipo.a
This could be caused by:
  * Loading two different object files which export the same symbol
  * Specifying the same object file twice on the GHCi command line
  * An incorrect `package.conf' entry, causing some object to be
loaded twice.
GHCi cannot safely continue in this situation.  Exiting now.  Sorry.


There are problems with the configure procedure of llvm-base. The 
configure file fetches the llvm-base.buildinfo.in file and replaces the 
variables with informations for your system. The result ends up in

  ~/.ghc/your-ghc-version/package.conf.d/llvm-base-3.0.0.1-some-hash.conf

You may post the content of this file for further diagnostics.


You said earlier that you use a custom path for llvm. Maybe you have 
conflicts between two versions, one in /usr/lib and one in /usr/local/lib?
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: [Haskell-cafe] mtl-2.1 severly broken, cabal needs blacklisting

2012-11-14 Thread Henning Thielemann


On Wed, 14 Nov 2012, Jean-Philippe Bernardy wrote:


On Tue, Nov 13, 2012 at 11:39 PM, Andreas Abel andreas.a...@ifi.lmu.de wrote:
  On 13.11.12 11:13 PM, Jean-Philippe Bernardy wrote:
Blacklisting equals releasing a bugfix.


Not quite.


I propose to *define* blacklisting as such. 

package-X.Y.Z.W is blacklisted if there exists package-X.Y.Z.V where V  W
(maybe I'm off by one position in the  version number scheme here, but you get 
the idea)


This rule is correct for packages following the Package Versioning Policy.
Currently cabal-install and Cabal make no assumptions about the employed 
versioning scheme.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] mtl-2.1 severly broken, cabal needs blacklisting

2012-11-13 Thread Henning Thielemann


On Tue, 13 Nov 2012, Bas van Dijk wrote:


On 13 November 2012 17:27, Andreas Abel andreas.a...@ifi.lmu.de wrote:

This calls for a means of blacklisting broken or malicious packages.

  cabal update

should also pull a blacklist of packages that will never be selected by
cabal install (except maybe by explicit user safety overriding).


Maybe we can use the existing preferred-versions file that cabal-install uses:

http://hackage.haskell.org/packages/archive/preferred-versions


It is also possible to deprecate a package. Is it possible to deprecate a 
single version? I'm afraid that the user is also not warned if he installs 
a deprecated package.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANN: data-dword: Long binary words from short ones

2012-10-11 Thread Henning Thielemann


On Thu, 11 Oct 2012, Mikhail Vorozhtsov wrote:

I'm pleased to announce my new little library, data-dword[1]. It provides 
Template Haskell utilities for defining binary word data types from low and 
high halves, e.g.


data Word96 = Word96 Word32 Word64 -- strictness is configurable
data Int96 = Int96 Int32 Word64


What is the advantage over 'largeword' which does the same with plain 
Haskell 98?


http://hackage.haskell.org/package/largeword

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] total Data.Map.! function

2012-10-09 Thread Henning Thielemann


Hi Joachim,


On Wed, 5 Oct 2012, Joachim Breitner wrote:


On Wed, 3 Oct 2012, Henning Thielemann wrote:

I wondered whether there is a brilliant typing technique that makes 
Data.Map.! a total function. That is, is it possible to give (!) a 
type, such that m!k expects a proof that the key k is actually present 
in the dictionary m? How can I provide the proof that k is in m?
 Same question for 'lab' (import Data.Graph.Inductive(lab)). That is, 
can there be a totalLab, with (totalLab gr = fromJust . lab gr) that 
expects a proof that the node Id is actually contained in a graph?


I think it is possible to do this using the same trick that ST is using, 
i.e. rank 2 types. The problem is that this code is likely to be 
unwieldy to use, as the variable needs to change with every change to 
the map – but I guess if you create your map once and then use it in 
various places without modification, this can actually work.


 Thank you for your detailed answer! I thought about such a tagging method 
but was missing your idea of updating tags of existing keys in order to 
reflect the knowledge about newly added keys.
 Your solution will certainly work for the set of methods you have 
implemented. All of your methods extend the set of keys or preserve it. 
But what about deletion? The certificate that key k is contained in a Map 
must be invalidated by the deletion of k. How could I add this to your 
approach?
 Maybe I should track the operations applied to the keys of a map and 
provide algebraic simplifications, like so:


   insert ::
  Ord k =
  Tagged s k - v - Tagged m (Map k v) -
  Tagged (Insert s m) (Map k v)

   lookup ::
  Ord k =
  Tagged s k - Tagged (Insert s m) (Map k v) - v

   -- * example simplifications

   commuteInsert ::
  Tagged (Insert s0 (Insert s1 m)) (Map k v) -
  Tagged (Insert s1 (Insert s0 m)) (Map k v)

   simplifyInsertInsert ::
  Tagged (Insert s (Insert s m)) (Map k v) -
  Tagged (Insert s m) (Map k v)

   simplifyInsertDelete ::
  Tagged (Insert s (Delete s m)) (Map k v) -
  Tagged (Insert s m) (Map k v)

   simplifyDeleteInsert ::
  Tagged (Delete s (Insert s m)) (Map k v) -
  Tagged (Delete s m) (Map k v)


   example =
  lookup k0 $ commuteInsert $
  insert k1 for $ insert k0 bar m


 I also thought about something like the exceptions trick. That is, a 
context like


   (ContainsKeyA k, ContainsKeyB k) = Map k x

 might tell that certain keys are in the Map. However, this would not only 
mean that I need a type class for every insertion, it would also not work 
reliably for deletion. If keyA = keyB, then deletion of keyA must also 
remove the ContainsKeyB constraint. :-(


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] total Data.Map.! function

2012-10-03 Thread Henning Thielemann


 I wondered whether there is a brilliant typing technique that makes 
Data.Map.! a total function. That is, is it possible to give (!) a type, 
such that m!k expects a proof that the key k is actually present in the 
dictionary m? How can I provide the proof that k is in m?
 Same question for 'lab' (import Data.Graph.Inductive(lab)). That is, can 
there be a totalLab, with (totalLab gr = fromJust . lab gr) that expects a 
proof that the node Id is actually contained in a graph?


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Call to arms: lambda-case is stuck and needs your help (fwd)

2012-07-19 Thread Henning Thielemann


I want to vote, too.

I am ok with all of

  case of

  \case

  \of

  \case of

For me single arguments are enough. We already have this restriction for 'case' 
and I can work around it simply by wrapping arguments in pairs temporarily (cf. 
curry $ \case ...).


I vote against LambdaIf, since if-then-else is already unnecessary and can be 
written by ifThenElse, and LambdaIf is just ifThenElse with different parameter 
order.


I vote against MultiCaseIf since it can be simply achieved by

ifThenElse b1 a1 $
ifThenElse b2 a2 $
ifThenElse b3 a3 $
a4

http://www.haskell.org/haskellwiki/Case

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Why GHC doesn't warn about LHS nullary-constructor pattern bindings?

2012-07-19 Thread Henning Thielemann


On Thu, 19 Jul 2012, Herbert Valerio Riedel wrote:


Recently, I was a bit suprised that GHC didn't warn about useless
`where` definitions such as the following when using `-Wall` (and I
couldn't find a respective warning GHC CLI flag which would have enabled
reporting a warning in this case -- unless I missed it)

 module Foo where

 foo :: Int - Int
 foo n = n + 1
   where
 Nothing = Just n


I think that

  where
x@Nothing = Just n

could be useful, if 'x' is evaluated somewhere.

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: [Haskell-cafe] [Haskell] A riddle...

2012-07-17 Thread Henning Thielemann


On Mon, 16 Jul 2012, Felipe Almeida Lessa wrote:


On Mon, Jul 16, 2012 at 12:33 PM, Vo Minh Thu not...@gmail.com wrote:

It seems like the infered type (and thus bounds) is different when you
force the result to be a Color or not. Just give explicit type
signatures and conversion functions.


Actually, just *always* give explicit type signatures.


Additionally, always compile with '-Wall' and follow the warnings. This 
way GHC will also warn about missing type signatures and it will even 
suggest type signatures.


(and use haskell-cafe for riddles, please :-)

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Sifflet type checker

2012-07-09 Thread Henning Thielemann


On Mon, 9 Jul 2012, gdwe...@iue.edu wrote:


data Type = TypeVar TypeVarName  -- named type variable
 | TypeCons TypeConsName [Type] -- constructed type
   deriving (Eq)

Do you still think my type checker would be useful to you,
or to Haskellers generally?


I see. Then it is probably not very useful for me. :-(



[1] http://www.youtube.com/watch?v=sXywCHR9WwE


Ah, I enjoyed the performance!


Nice to hear that you like it!

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANNOUNCE: Sifflet visual programming language, release 2.0.0.0

2012-07-07 Thread Henning Thielemann


On Thu, 5 Jul 2012, gdwe...@iue.edu wrote:


Sifflet and sifflet-lib 2.0.0.0, now available on Hackage!

This version introduces a type checker and partial support
for higher order functions in Sifflet, the visual, functional
programming language and support system for students learning
about recursion.


You have implemented your own type-checker, right? I plan to add a 
type-checker to our live-sequencer project. [1] So far I have thought 
about using the Helium type checker but I have not done it so far. If you 
want to make your type-checker useful for other projects, you may put it 
into a separate package without the hard to install dependencies on cairo 
and glib.


[1] http://www.youtube.com/watch?v=sXywCHR9WwE

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANNOUNCE: lens-family-th 0.1.0.0

2012-07-07 Thread Henning Thielemann


On Sat, 7 Jul 2012, rocon...@theorem.ca wrote:


On Fri, 6 Jul 2012, Dan Burton wrote:

Following the announcement of lens-family, I'm pleased to announce 
lens-family-th 0.1.0.0, a Template Haskell library supplying macros to 
generate

lens-family lenses for fields of data types declared with record syntax.

Be warned that currently, type signatures are *not* generated alongside the 
lens definitions. Type inference should correctly determine the type of the
generated lenses, but I have structured the library code so that in the 
future, type signatures can also be generated. Patches welcome!


http://hackage.haskell.org/package/lens-family-th


I cannot help but wonder if it is better to *not* generate type signatures 
(or at least have an option not to).


In data-accessor-template we generate type signatures, also because it 
avoids warnings for missing type signatures. However it needed some 
fine-tuning before it worked in all cases.



At the moment one can write:


import Lens.Family2.Stock
import Lens.Family2.TH

data Foo a = Foo { _bar :: Int, _baz :: a }
   deriving (Show, Read, Eq, Ord)
$(mkLenses ''Foo)

-- | My documentation for the 'bar' lens.
bar :: Lens (Foo a) Int

-- | My documentation for the 'baz' lens.
baz :: LensFamily (Foo a) (Foo a') a a'


I don't know if it is possible to add haddock to functions whose type 
signatures are generated by template haskell.


Could the documentation be an argument of mkLenses?

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANNOUNCE: lens-family-th 0.1.0.0

2012-07-07 Thread Henning Thielemann


On Sat, 7 Jul 2012, Dan Burton wrote:


  Could the documentation be an argument of mkLenses?

 Does haddock run on the template-haskell expanded code?
 
TH macros must have type Q [Dec]. Dec has no constructor for comments, with the 
exception of pragmas. This
might be feature request worthy, though it is a rather strange case to want to 
generate comments via a macro.


Alternatively, Haddock allows you to document functions in the export 
list.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] [ANN] GenCheck - a generalized property-based testing framework

2012-06-20 Thread Henning Thielemann


On Tue, 19 Jun 2012, Jacques Carette wrote:


Its main novel features are:

* introduces a number of /testing strategies/ and /strategy combinators/
* introduces a variety of test execution methods
* guarantees uniform sampling (at each rank) for the random strategy
* guarantees both uniqueness and coverage of all structures for the
  exhaustive strategy
* introduces an /extreme/ strategy for testing unbalanced structures
* also introduces a /uniform/ strategy which does uniform sampling
  along an enumeration
* allows different strategies to be mixed; for example one can
  exhaustively test all binary trees up to a certain size, filled with
  random integers.
* complete separation between properties, generators, testing
  strategies and test execution methods



This sounds very interesting to me since I had a lot of trouble with 
changed test case distributions when switching from QuickCheck-1 to 
QuickCheck-2. It was mainly that tested numbers became much bigger in 
QuickCheck-2 and if I used the numbers as size of lists, then tests could 
not be run in reasonable time anymore. Thus I think more control over 
test-case generation is necessary.


QuickCheck is Haskell-98 and thus is very portable. I see that GenCheck 
needs some more extensions - type families, multi-parameter type classes, 
what else?


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] relocation R_X86_64_PC32 against undefined symbol

2012-06-20 Thread Henning Thielemann


Just for the record:

I compiled with GHC and got the linker error:

/usr/bin/ld: dist/build/.../Module.dyn_o: relocation R_X86_64_PC32 against 
undefined symbol `..._xyz1_closure' can not be used when making a shared 
object; recompile with -fPIC



Problem was that I forgot to declare Module in the Cabal description.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] converting functional dependencies to type families

2012-06-11 Thread Henning Thielemann


On Mon, 11 Jun 2012, Simon Peyton-Jones wrote:


Thanks.  I've linked to it from
http://www.haskell.org/haskellwiki/GHC/Type_families#Frequently_asked_questions


Thank you! I already added this and another link to a new See also 
section below. Which one shall we maintain?


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] converting functional dependencies to type families

2012-06-10 Thread Henning Thielemann


On Thu, 7 Jun 2012, Simon Peyton-Jones wrote:


Very useful!  Maybe worth turning into a page on the Haskell wiki?


I created one:
  http://www.haskell.org/haskellwiki/Functional_dependencies_vs._type_families

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell] HaL7: Haskell-Treffen in Halle/Saale, Freitag 2012-07-13

2012-06-06 Thread Henning Thielemann


For our German readers:

Es ist wieder so weit: Am Freitag, 13. Juli laden wir zum 7. Haskell-Treffen 
HaL ein, diesmal nach Halle an der Saale. Wir bieten eine bunte Mischung aus 
Tutorien zum Mitmachen, Vortraegen zum Anhoeren und Gelegenheiten zum 
Fachsimpeln, theoretisches wie praktisches, ernstes wie heiteres.


Das Programm im Schnelldurchlauf ist:

   vormittags 6 Tutorien
  09:30 - 11:00  snap  repa  schule
  11:30 - 13:00  reactive  generics  liveseq

   nachmittags 4 Vortraege
  14:30 - 15:15  Dorn: Schule
  15:15 - 16:00  Voigtlaender: ADP
  16:30 - 17:15  Goergens: XenClient
  17:15 - 18:00  Eijkel: Hommage

   sonstiges:
  09:00 - 11:30  Installationshilfen
  11:00 - 11:30  Kaffeepause
  13:00 - 14:30  Mittagspause
  16:00 - 16:30  Kaffeepause
  19:00 - Ende   Abendessen und Fachsimpelei im Restaurant


Die Details finden Sie hier:
  http://iba-cg.de/hal7.html

und die Anmeldung da:
  http://sim.mathematik.uni-halle.de:8080/hal7/


Bitte melden Sie sich bis zum 4. Juli an.

Wir freuen uns auf Ihr zahlreiches Erscheinen!

für das Programmkomitee
Henning Thielemann

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell-cafe] HaL7: Haskell-Treffen in Halle/Saale, Freitag 2012-07-13

2012-06-06 Thread Henning Thielemann


For our German readers:

Es ist wieder so weit: Am Freitag, 13. Juli laden wir zum 7. Haskell-Treffen 
HaL ein, diesmal nach Halle an der Saale. Wir bieten eine bunte Mischung aus 
Tutorien zum Mitmachen, Vortraegen zum Anhoeren und Gelegenheiten zum 
Fachsimpeln, theoretisches wie praktisches, ernstes wie heiteres.


Das Programm im Schnelldurchlauf ist:

   vormittags 6 Tutorien
  09:30 - 11:00  snap  repa  schule
  11:30 - 13:00  reactive  generics  liveseq

   nachmittags 4 Vortraege
  14:30 - 15:15  Dorn: Schule
  15:15 - 16:00  Voigtlaender: ADP
  16:30 - 17:15  Goergens: XenClient
  17:15 - 18:00  Eijkel: Hommage

   sonstiges:
  09:00 - 11:30  Installationshilfen
  11:00 - 11:30  Kaffeepause
  13:00 - 14:30  Mittagspause
  16:00 - 16:30  Kaffeepause
  19:00 - Ende   Abendessen und Fachsimpelei im Restaurant


Die Details finden Sie hier:
  http://iba-cg.de/hal7.html

und die Anmeldung da:
  http://sim.mathematik.uni-halle.de:8080/hal7/


Bitte melden Sie sich bis zum 4. Juli an.

Wir freuen uns auf Ihr zahlreiches Erscheinen!

für das Programmkomitee
Henning Thielemann

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] converting functional dependencies to type families

2012-06-05 Thread Henning Thielemann


Hi all,

when I reported a typechecker performance problem related to functional 
dependencies

   http://hackage.haskell.org/trac/ghc/ticket/5970
 I promised to try to convert from functional dependencies to type 
families.


Thus I converted my code and the llvm package to type-families:
   http://code.haskell.org/~thielema/llvm-tf/


Here are some of my experiences:

== Advantages of TypeFamilies ==

* Speed

For what I did the type families solution was considerably faster than the 
functional dependencies code at least in GHC-7.4.1. Thus the bug in ticket 
5970 does no longer hurt me. (In GHC-6.12.3 the conversion to type 
families made the compilation even slower.)



* Anonymous type function values

One of the most annoying type classes of the llvm package was the IsSized 
class:


  class (LLVM.IsType a, IsPositive size) = IsSized a size | a - size

where size is a type-level decimal natural number.

Many llvm functions require that an LLVM type has a size where the 
particular size is not important. However, I always have to name the size 
type. I also cannot get rid of it using a subclass, like


  class (IsSized a size) = IsAnonymouslySized a where

The 'size' type is somehow sticky.

The conversion of this type class to type families is straightforward:

  class (IsType a, PositiveT (SizeOf a)) = IsSized a where
 type SizeOf a :: *

Now I have to use SizeOf only if needed. I can also easily define 
sub-classes like


  class (IsSized a) = C a where


* No TypeSynonymInstances

At the right hand side of a 'type instance' I can use type synonyms like

  type instance F T = String

without the TypeSynonymInstance extension. This feels somehow more correct 
than refering to a type synonym in a class instance head like in


  instance C T String where

The compiler does not need to analyze String in order to find the correct 
instance.



* No FlexibleInstances

The same applies to

  instance C (T a) (A (B a))

which is a flexible instance that is not required for

  type instance F (T a) = A (B a)


* No MultiParamTypeClass, No UndecidableInstances

I have some type classes that convert a type to another type and a tuple 
of types to another tuple of types where the element types are converted 
accordingly. With functional dependencies:


  class MakeValueTuple haskellTuple llvmTuple | haskellTuple - llvmTuple where

  instance (MakeValueTuple ha la, MakeValueTuple hb lb) =
   MakeValueTuple (ha,hb) (la,lb)

The class is a multi-parameter type class and the instance is undecidable.

This is much simpler with type families:

  class MakeValueTuple haskellTuple where
type ValueTuple haskellTuple :: *

  instance (MakeValueTuple ha, MakeValueTuple hb) =
   MakeValueTuple (ha,hb) where
type ValueTuple (ha,hb) = (ValueTuple ha, ValueTuple hb)



Thus summarized: Type families may replace several other type extensions. 
If I ignore the associated type functions then many classes become Haskell 
98 with Haskell 98 instances. This is good because those instances prevent 
instance conflicts with other non-orphan instances.



== Disadvantage of TypeFamilies ==

* Redundant instance arguments

I have to write the type arguments both in the instance head and in the 
function argument. This is especially annoying in the presence of 
multi-parameter type classes with bidirectional dependencies. E.g.


class (a ~ Input parameter b, b ~ Output parameter a) = C parameter a b where
   type Input  parameter b :: *
   type Output parameter a :: *
   process :: Causal p (parameter, a) b

instance (...) = C (FilterParam a) v (FilterResult v) where
   type Input  (FilterParam a) (FilterResult v) = v
   type Output (FilterParam a) v = FilterResult v


With functional dependencies it was:

class C parameter a b | parameter a - b, parameter b - a where
   process :: Causal p (parameter, a) b

instance (...) = C (FilterParam a) v (FilterResult v) where


* Bidirectional dependencies

In GHC-6.12.3 it was not possible to write

  class (a ~ Back b, b ~ Forth a) = C a b where

Fortunately, this is now allowed in GHC-7. But bidirectional dependencies 
are still cumbersome to work with as shown in the example above.



* Equality constraints are not supported for newtype deriving

Not so important, just for completeness:
  http://hackage.haskell.org/trac/ghc/ticket/6088


== Confusions ==

* Upper case type function names

Why are type function names upper case, not lower case? They are not 
constructors after all. Maybe this is one reason, why I forget from time 
to time that type functions are not injective.


Sure, lower-case type variables are implicitly forall quantified in 
Haskell 98. In the presence of lower-case type functions we would need 
explicit forall quantification.


* Why can associated types not be exported by C(AssocType) syntax?

Why must they be exported independently from the associated class?


* FlexibleContexts

The context (Class (TypeFun a)) requires 

Re: [Haskell] Creating a factorial function in GHC

2012-05-09 Thread Henning Thielemann


On Wed, 9 May 2012, Angus Comber wrote:


I am trying to create a factorial function in GHC.  I am following the
online learnyouahaskell.com book (specifically types-and-typeclasses
page).

Bear in mind this is my day 1 of learning Haskell.


Then beginn...@haskell.org might be a better place to ask, since
haskell@haskell.org is for announcements.



The book suggests:

factorial :: Integer - Integer
factorial n = product [1..n]

But if I enter first line then press Enter I see:
interactive:1:1 Not in scope: 'factorial'

What am I doing wrong?


The code you entered is intended to be the content of a text file that can 
be loaded into GHCi or Hugs. If you want to write it immediately into GHCi 
you may write:


Prelude let factorial :: Integer - Integer; factorial n = product [1..n]

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] HaL-7, 2012-07-13, Call for submissions

2012-04-23 Thread Henning Thielemann
Call for submissions and Save the date

for our local Haskell Workshop in Halle/Saale, Germany.

Tutorials, talks, demonstrations ... everything welcome.

Workshop language is German (mainly), and English (by request).

Submission deadline: May, 21, Workshop date: June, 22



Workshop homepage: http://iba-cg.de/hal7.html


The complete call in German:

-

Aufruf zum Einreichen von Beiträgen
und Hinweis zum Vormerken des Termins

Was: Haskell-Treffen HaL-7
Wann: Freitag, 13.07.2012
Wo: Institut für Informatik an der Martin-Luther-Universität in Halle an
der Saale

Wir suchen Vorträge zu Haskell im Besonderen und der funktionalen
Programmierung im Allgemeinen, zum Beispiel zu den Themen

* Neues von Sprache, Bibliotheken, Werkzeugen,
* Anwendungen von Kunst bis Industrie,
* Lehre an Schulen und Hochschulen,

gerne aber auch zu anderen Themen.

Die Beiträge können präsentiert werden als

* Tutorium (60 .. 90 min)
* Vortrag (30 min)
* Demonstration, künstlerische Aufführung

Die Veranstaltungssprache ist Deutsch, in begründeten Ausnahmen
Englisch. Presentations will be given in German but we can switch to
English if requested.

Bitte reichen Sie Kurzfassungen der Beiträge ein (2 bis 4 Seiten), die
dem Programmkomitee eine Einschätzung ermöglichen. Die Kurzfassung soll
mit einer Zusammenfassung (10 Zeilen) beginnen und einem
Literaturverzeichnis enden.

Teilnehmer des Workshops sind Interessenten (keine Erfahrung mit
Haskell/FP), Anfänger (wenig Erfahrung) und Experten. Wir bitten die
Vortragenden, die Zielgruppe des Beitrags anzugeben und die nötigen
Vorkenntnisse zu beschreiben. Bei Tutorien sollen Teilnehmer auf eigenen
Rechnern arbeiten. Bitte beschreiben Sie dazu die vorher zu
installierende Software.

Schicken Sie Beitragsvorschläge als PDF-Dokument bis zum

21.05.2012

per Mail an hal-committee at iba-cg punkt de oder an ein Mitglied des
Programmkomitees.


Programmkomitee

* Henning Thielemann - Univ. Halle (Vorsitzender),

* Petra Hofstedt - BTU Cottbus,
* Alf Richter - iba CG Leipzig,
* Uwe Schmidt - FH Wedel,
* Janis Voigtländer - Univ. Bonn,
* Johannes Waldmann - HTWK Leipzig.



Mit besten Grüßen
Henning Thielemann


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] HaL-7, 2012-07-13, Call for submissions

2012-04-23 Thread Henning Thielemann


On Mon, 23 Apr 2012, Henning Thielemann wrote:


Call for submissions and Save the date

for our local Haskell Workshop in Halle/Saale, Germany.

Tutorials, talks, demonstrations ... everything welcome.

Workshop language is German (mainly), and English (by request).

Submission deadline: May, 21,



Arrg, this was the wrong date:


Workshop date: June, 22




The correct one is July, 13 !





Workshop homepage: http://iba-cg.de/hal7.html


The complete call in German:

-

Aufruf zum Einreichen von Beiträgen
und Hinweis zum Vormerken des Termins

Was: Haskell-Treffen HaL-7
Wann: Freitag, 13.07.2012
Wo: Institut für Informatik an der Martin-Luther-Universität in Halle an
der Saale

Wir suchen Vorträge zu Haskell im Besonderen und der funktionalen
Programmierung im Allgemeinen, zum Beispiel zu den Themen

   * Neues von Sprache, Bibliotheken, Werkzeugen,
   * Anwendungen von Kunst bis Industrie,
   * Lehre an Schulen und Hochschulen,

gerne aber auch zu anderen Themen.

Die Beiträge können präsentiert werden als

   * Tutorium (60 .. 90 min)
   * Vortrag (30 min)
   * Demonstration, künstlerische Aufführung

Die Veranstaltungssprache ist Deutsch, in begründeten Ausnahmen
Englisch. Presentations will be given in German but we can switch to
English if requested.

Bitte reichen Sie Kurzfassungen der Beiträge ein (2 bis 4 Seiten), die
dem Programmkomitee eine Einschätzung ermöglichen. Die Kurzfassung soll
mit einer Zusammenfassung (10 Zeilen) beginnen und einem
Literaturverzeichnis enden.

Teilnehmer des Workshops sind Interessenten (keine Erfahrung mit
Haskell/FP), Anfänger (wenig Erfahrung) und Experten. Wir bitten die
Vortragenden, die Zielgruppe des Beitrags anzugeben und die nötigen
Vorkenntnisse zu beschreiben. Bei Tutorien sollen Teilnehmer auf eigenen
Rechnern arbeiten. Bitte beschreiben Sie dazu die vorher zu
installierende Software.

Schicken Sie Beitragsvorschläge als PDF-Dokument bis zum

   21.05.2012

per Mail an hal-committee at iba-cg punkt de oder an ein Mitglied des
Programmkomitees.


Programmkomitee

* Henning Thielemann - Univ. Halle (Vorsitzender),

* Petra Hofstedt - BTU Cottbus,
* Alf Richter - iba CG Leipzig,
* Uwe Schmidt - FH Wedel,
* Janis Voigtländer - Univ. Bonn,
* Johannes Waldmann - HTWK Leipzig.



Mit besten Grüßen
Henning Thielemann




___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell-cafe] HaL-7, 2012-07-13, Call for submissions

2012-04-23 Thread Henning Thielemann


Call for submissions and Save the date

for our local Haskell Workshop in Halle/Saale, Germany.

Tutorials, talks, demonstrations ... everything welcome.

Workshop language is German (mainly), and English (by request).

Submission deadline: May, 21, Workshop date: July, 13



Workshop homepage: http://iba-cg.de/hal7.html


The complete call in German:

-

Aufruf zum Einreichen von Beiträgen
und Hinweis zum Vormerken des Termins

Was: Haskell-Treffen HaL-7
Wann: Freitag, 13.07.2012
Wo: Institut für Informatik an der Martin-Luther-Universität in Halle an
der Saale

Wir suchen Vorträge zu Haskell im Besonderen und der funktionalen
Programmierung im Allgemeinen, zum Beispiel zu den Themen

* Neues von Sprache, Bibliotheken, Werkzeugen,
* Anwendungen von Kunst bis Industrie,
* Lehre an Schulen und Hochschulen,

gerne aber auch zu anderen Themen.

Die Beiträge können präsentiert werden als

* Tutorium (60 .. 90 min)
* Vortrag (30 min)
* Demonstration, künstlerische Aufführung

Die Veranstaltungssprache ist Deutsch, in begründeten Ausnahmen
Englisch. Presentations will be given in German but we can switch to
English if requested.

Bitte reichen Sie Kurzfassungen der Beiträge ein (2 bis 4 Seiten), die
dem Programmkomitee eine Einschätzung ermöglichen. Die Kurzfassung soll
mit einer Zusammenfassung (10 Zeilen) beginnen und einem
Literaturverzeichnis enden.

Teilnehmer des Workshops sind Interessenten (keine Erfahrung mit
Haskell/FP), Anfänger (wenig Erfahrung) und Experten. Wir bitten die
Vortragenden, die Zielgruppe des Beitrags anzugeben und die nötigen
Vorkenntnisse zu beschreiben. Bei Tutorien sollen Teilnehmer auf eigenen
Rechnern arbeiten. Bitte beschreiben Sie dazu die vorher zu
installierende Software.

Schicken Sie Beitragsvorschläge als PDF-Dokument bis zum

21.05.2012

per Mail an hal-committee at iba-cg punkt de oder an ein Mitglied des
Programmkomitees.


Programmkomitee

* Henning Thielemann - Univ. Halle (Vorsitzender),

* Petra Hofstedt - BTU Cottbus,
* Alf Richter - iba CG Leipzig,
* Uwe Schmidt - FH Wedel,
* Janis Voigtländer - Univ. Bonn,
* Johannes Waldmann - HTWK Leipzig.



Mit besten Grüßen
Henning Thielemann

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANNOUNCE: notcpp-0.0.1

2012-04-13 Thread Henning Thielemann


On Fri, 13 Apr 2012, Ben Millwood wrote:


But I never liked using CPP: it completely defeats haskell-src-exts
and hence things like SourceGraph, and anyway it's not designed for
Haskell and doesn't at all understand its structure, or fit with its
syntax. With a little thought, I wondered if creative use of template
haskell might not achieve the same goal. It turned out it did, and
emboldened with this knowledge I set out to write a new package making
this technique available to others.


I never liked CPP in Haskell, too. The problem is: I also do not like 
Template Haskell. :-) Whereever possible I use a Cabal flag and a 
conditional Hs-Source-Dirs.


http://www.haskell.org/haskellwiki/Cabal/Developer-FAQ#Adapt_to_different_systems_without_CPP

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] Higher types in contexts

2012-03-05 Thread Henning Thielemann


moved to haskell-cafe


On Mon, 5 Mar 2012, Barney Hilken wrote:


Is there any deep reason why I can't write a polymorphic type in a context? I 
think the record update problem can be (sort of) solved if you could write:

class Has r Rev (forall a. [a] - [a]) = HRClass r where
setHRClass :: (forall a.[a] - [a]) - r - r

but polymorphic types are not allowed in contexts. Is this one of the problems SPJ 
considers Hard or is it a feasible extension?


I don't know what you want to do, but you may wrap the (forall a. [a] - 
[a]) in an existential type:


data ListFunc = forall a. ListFunc ([a] - [a])

class Has r Rev ListFunc = HRClass r where
setHRClass :: ListFunc - r - r

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell] Support tools for development with Cabal and Darcs

2012-02-10 Thread Henning Thielemann


I have uploaded three packages to Hackage that shall simplify maintaining 
cabal packages under darcs revision control. They simplify tasks like 
uploading packages after some tests, cabal version handling, compiling 
multiple local packages in the right order, replacing identifiers in 
multiple files, renaming modules.


* http://hackage.haskell.org/package/darcs-scripts
* http://hackage.haskell.org/package/cabal-scripts
* http://hackage.haskell.org/package/cabal-sort

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell-cafe] [Haskell] Support tools for development with Cabal and Darcs

2012-02-10 Thread Henning Thielemann


On Fri, 10 Feb 2012, Duncan Coutts wrote:


Would you mind giving me a breif explanation of the compiling
multiple local packages in the right order feature? I'd like to
understand what is missing in cabal-install in this respect.

Currently with cabal-install you can say:

cabal install ./a ./b ./c

and it will install the packages in those directories in the right
order. (It is also possible to list other install targets including
local and remote tarballs, and of course packages from hackage).


I believe that the first version of cabal-sort is older than this 
cabal-install feature. Nonetheless, cabal-sort can be used for other 
purposes, too. E.g. you can use plain Cabal installation, when 'cabal 
install' does not work due to problems in constraint solving. You can 
upload packages in topologically sorted order to Hackage, such that 
building on Hackage works correctly. Is this also done by cabal-install's 
upload command? You can also use cabal-sort for stepping into package 
directories and do some manual updates before installing.


However, I will add references to the new cabal-install features in the 
documentation of cabal-sort.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] Support tools for development with Cabal and Darcs

2012-02-10 Thread Henning Thielemann


On Fri, 10 Feb 2012, Duncan Coutts wrote:


I wonder if you have any suggestions for UI changes/improvements for
cabal-install for working with related sets of local packages
(something it's fairly weak on at the moment). Are there things in
cabal-sort you think we should just lift directly into cabal-install
or variations etc?


Sure, you can add a command 'sort' that outputs the given packages in 
topologically sorted order. :-)


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] Support tools for development with Cabal and Darcs

2012-02-10 Thread Henning Thielemann


On Fri, 10 Feb 2012, Henning Thielemann wrote:


On Fri, 10 Feb 2012, Duncan Coutts wrote:


I wonder if you have any suggestions for UI changes/improvements for
cabal-install for working with related sets of local packages
(something it's fairly weak on at the moment). Are there things in
cabal-sort you think we should just lift directly into cabal-install
or variations etc?


Sure, you can add a command 'sort' that outputs the given packages in 
topologically sorted order. :-)


I missed something: The reason for the current upload was a new cabal-sort 
feature that emits the package dependencies as a Makefile in order to 
allow building packages in parallel using 'make -j'. Of course, a '--jobs' 
option would also be a nice addition to 'cabal install'.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [Haskell] ANNOUNCE multiarg - parser combinators for command line parsing

2012-01-30 Thread Henning Thielemann


On Sun, 29 Jan 2012, Simon Meier wrote:


I'm currently using Neil Mitchell's cmdargs package [1]. How does your
package compare to that?


Last time I checked cmdargs it was not referential transparent. Is 
multiarg better in this respect?


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] black Wikipedia (Was: PhD program at Portland State accepting applications)

2012-01-18 Thread Henning Thielemann


On Wed, 18 Jan 2012, Nathan Collins wrote:


- Portland is a very popular US city, known for beer, bikes, music,
and street food:

http://en.wikipedia.org/wiki/Portland_Oregon (wikipedia is blacked out today)


Maybe it is only a JavaScript trick. In Firefox (with JavaScript) I see 
the complete a page before it is overwritten by the protest page. In 
Konqueror of KDE 3 (with and without JavaScript) I can read the Wiki pages 
without problems. Edit however is really disabled. Sometimes I am glad to 
have the old technology available. :-)



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] black Wikipedia

2012-01-18 Thread Henning Thielemann


On Wed, 18 Jan 2012, Andrew Butterfield wrote:


Just add ?banner=none to the url if you really have to read the page


Maybe the intention was to demonstrate that censorship (in this case 
self-censorship) is mostly a problem for average users but not for 
advanced users.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


  1   2   3   4   5   6   7   8   9   10   >