FLOPS 2016: 13th International Symposium on Functional and Logic Programming
March 4-6, 2016, Kochi, Japanhttp://www.info.kochi-tech.ac.jp/FLOPS2016/
Call for Participation and Posters/Demos
Registration will be open on Monday, Dec 21, 2015.
Early registration deadline is Monday,
of Informatics, Japan
Andy KingUniversity of Kent, UK (PC Co-Chair)
Oleg KiselyovTohoku University, Japan (PC Co-Chair)
Hsiang-Shang Ko National Institute of Informatics, Japan
Julia Lawall Inria-Whisper, France
Andres Loeh Well-Typed LLP, UK
Anil
London, UK
Makoto Kanazawa National Institute of Informatics, Japan
Andy KingUniversity of Kent, UK (PC Co-Chair)
Oleg KiselyovTohoku University, Japan (PC Co-Chair)
Hsiang-Shang Ko National Institute of Informatics, Japan
Julia Lawall Inria-Whisper, France
of Informatics, Japan
Andy KingUniversity of Kent, UK (PC Co-Chair)
Oleg KiselyovTohoku University, Japan (PC Co-Chair)
Hsiang-Shang Ko National Institute of Informatics, Japan
Julia Lawall Inria-Whisper, France
Andres Löh Well-Typed LLP, UK
Anil Madhavapeddy
, USA
Jacques Garrigue Nagoya University, Japan
Dave Herman Mozilla, USA
Stefan HoldermansVector Fabrics, Netherlands
Oleg Kiselyov (Chair)University of Tsukuba, Japan
Keiko Nakata Tallinn University of Technology, Estonia
Didier Remy INRIA
Ochanomizu University, Japan
Matthew FluetRochester Institute of Technology, USA
Jacques Garrigue Nagoya University, Japan
Dave Herman Mozilla, USA
Stefan HoldermansVector Fabrics, Netherlands
Oleg Kiselyov (Chair)University of Tsukuba, Japan
Mozilla, USA
Stefan HoldermansVector Fabrics, Netherlands
Oleg Kiselyov (Chair)Monterey, CA, USA
Keiko Nakata Tallinn University of Technology, Estonia
Didier Remy INRIA Paris-Rocquencourt, France
Zhong Shao Yale University, USA
Hongwei
Rochester Institute of Technology, USA
Jacques Garrigue Nagoya University, Japan
Dave Herman Mozilla, USA
Stefan HoldermansVector Fabrics, Netherlands
Oleg Kiselyov (Chair)Monterey, CA, USA
Keiko Nakata Tallinn University of Technology, Estonia
Ochanomizu University, Japan
Matthew FluetRochester Institute of Technology, USA
Jacques Garrigue Nagoya University, Japan
Dave Herman Mozilla, USA
Stefan HoldermansVector Fabrics, Netherlands
Oleg Kiselyov (Chair)Monterey, CA, USA
Keiko Nakata
chair.
Program Committee
Kenichi Asai Ochanomizu University, Japan
Matthew FluetRochester Institute of Technology, USA
Jacques Garrigue Nagoya University, Japan
Dave Herman Mozilla, USA
Stefan HoldermansVector Fabrics, Netherlands
Oleg Kiselyov
Thiago Negri wrote:
Why type inference can't resolve this code?
{-# LANGUAGE RankNTypes, ConstraintKinds #-}
bar :: (Num a, Num b) = (forall c. Num c = c - c) -Either a b -Either a b
bar f (Left a) = Left (f a)
bar f (Right b) = Right (f b)
bar' = bar (+ 2) -- This compiles ok
foo ::
(University of Oxford, UK)
Alain Frisch (LexiFi, France)
Ronald Garcia (University of British Columbia, Canada)
Zhenjiang Hu (National Institute of Informatics, Japan)
Paul H J Kelly (Imperial College, UK)
Oleg Kiselyov (Monterey, USA)
Naoki Kobayashi (University of Tokyo, Japan
I've been toying with using Data Types a la Carte to get type
representations, a `Typeable` class and dynamic types parameterized by a
possibly open universe:
If the universe is potentially open, and if we don't care about
exhaustive pattern-matching check (which is one of the principal
Evan Laforge wrote:
I have a typeclass which is instantiated across a closed set of 3
types. It has an ad-hoc set of methods, and I'm not too happy with
them because being a typeclass forces them to all be defined in one
place, breaking modularity. A sum type, of course, wouldn't have that
[I too had the problem sending this e-mail to Haskell list.
I got a reply saying the message awaits moderator approval]
Evan Laforge wrote:
I have a typeclass which is instantiated across a closed set of 3
types. It has an ad-hoc set of methods, and I'm not too happy with
them because being
For lazy I/O, using shows in Haskell is a good analogue of using
#printOn: in Smalltalk. The basic form is include this as PART of
a stream, with convert this to a whole string as a derived form.
What the equivalent of this would be for Iteratees I don't yet
understand.
Why not to try
I must stress that OpenUnion1.hs described (briefly) in the paper
is only one implementation of open unions, out of many possible.
For example, I have two more implementations. A year-old version of
the code implemented open unions *WITHOUT* overlapping instances or
Typeable.
Perhaps effect libraries (there are several to choose from) could be a
better answer to Fork effects than monad transformers. One lesson from
the recent research in effects is that we should start thinking what
effect we want to achieve rather than which monad transformer to
use. Using ReaderT or
ivan.chollet wrote:
let's consider the following:
let fd = Unix.open ...
let fd = Unix.open ...
At this point one file descriptor cannot be closed. Static analysis will
have trouble catching these bugs, so do humans.
Both sentences express false propositions.
The given code, if Haskell,
Here is a snippet from a real code that could benefit from
non-recursive let. The example is notable because it incrementally
constructs not one but two structures (both maps), ast and headers.
The maps are constructed in a bit interleaved fashion, and stuffing
them into the same State would be
Here is one possible approach. First, convert the propositional
formula into the conjunctive normal form (disjunctive will work just
as well). Recall, the conjunctive normal form (CNF) is
type CNF = [Clause]
type Clause = [Literal]
data Literal = Pos PropLetter | Neg PropLetter
type
I'd like to emphasize that there is a precedent to non-recursive let
in the world of (relatively pure) lazy functional programming.
The programming language Clean has such non-recursive let and uses
it and the shadowing extensively. They consider shadowing a virtue,
for uniquely typed data.
[reposting to Haskell-prime]
Jon Fairbairn wrote:
It just changes forgetting to use different variable names because of
recursion (which is currently uniform throughout the language) to
forgetting to use non recursive let instead of let.
Let me bring to the record the message I just wrote on
Andreas wrote:
The greater evil is that Haskell does not have a non-recursive let.
This is source of many non-termination bugs, including this one here.
let should be non-recursive by default, and for recursion we could have
the good old let rec.
Hear, hear! In OCaml, I can (and often do)
Jon Fairbairn wrote:
It just changes forgetting to use different variable names because of
recursion (which is currently uniform throughout the language) to
forgetting to use non recursive let instead of let.
Let me bring to the record the message I just wrote on Haskell-cafe
If you would like to write
let (x,s) = foo 1 [] in
let (y,s) = bar x s in
let (z,s) = baz x y s in
instead, use a state monad.
Incidentally I did write almost exactly this code once. Ironically, it
was meant as a lead-on to the State monad.
But there have been other cases
Alberto G. Corona wrote:
I think that a non-non recursive let could be not compatible with the pure
nature of Haskell.
I have seen this sentiment before. It is quite a mis-understanding. In
fact, the opposite is true. One may say that Haskell is not quite pure
_because_ it has recursive let.
TP wrote:
pr :: Name - ExpQ
pr n = [| putStrLn $ (nameBase n) ++ = ++ show $(varE n) |]
The example is indeed problematic. Let's consider a simpler one:
foo :: Int - ExpQ
foo n = [|n + 1|]
The function f, when applied to an Int (some bit pattern in a machine
register), produces _code_.
It seems very interesting, but I have not currently the time to make a
detailed comparison with vector/tensor algebra. Moreover I have not
I would suggest the freely available
Oersted Medal Lecture 2002
by David Hestenes
Well, I guess you might be interested in geometric algebra then
http://dl.acm.org/citation.cfm?id=1173728
because Geometric Algebra is a quite more principled way of doing
component-free calculations. See also the web page of the author
http://staff.science.uva.nl/~fontijne/
I'm late to this discussion and must have missed the motivation for
it. Specifically, how is your goal, vector/tensor operations that are
statically assured well-dimensioned differs from general
well-dimensioned linear algebra, for which several solutions have been
already offered. For example,
Type classes are the approach to constrain type variables, to bound
polymorphism and limit the set of types the variables can be
instantiated with. If we have two type variables to constrain,
multi-parameter type classes are the natural answer then. Let's take
this solution and see where it leads
I must say though that I'd rather prefer Adres solution because his
init
init :: (forall a. Inotify a - IO b) - IO b
ensures that Inotify does not leak, and so can be disposed of at the
end. So his init enforces the region discipline and could, after a
It's probably not easy to do
Mateusz Kowalczyk wrote:
Is there a way however to do something along the lines of:
class Eq a = Foo a where bar :: a - a - Bool bar = (==)
class Num a = Foo a where bar :: a - a - Bool bar _ _ = False
This would allow us to make an instance of Num be an instance of Foo
or an instance of
I guess you might like then
http://okmij.org/ftp/Haskell/types.html#Prepose
which discusses implicit parameters and their drawbacks (see Sec 6.2).
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
But Haskell (and GHC) have existential types, and your prototype code
works with GHC after a couple of trivial changes:
main = do
W nd0 - init
wd0 - addWatch nd0 foo
wd1 - addWatch nd0 bar
W nd1 - init
wd3 - addWatch nd1 baz
printInotifyDesc nd0
printInotifyDesc nd1
I'm a bit curious
* be reliable in the presence of async exceptions (solved by conduit,
pipes-safe),
* hold on to resources only as long as necessary (solved by conduit
and to some degree by pipes-safe),
Are you aware of
http://okmij.org/ftp/Streams.html#regions
which
In your class Sum example,
class Sum x y z | x y - z, x z - y
your own solution has a bunch of helper classes
First of all, on the top of other issues, I haven't actually shown an
implementation in the message on Haskell'. I posed this as a general
issue.
In special cases like
In your class Sum example,
class Sum x y z | x y - z, x z - y
your own solution has a bunch of helper classes
First of all, on the top of other issues, I haven't actually shown an
implementation in the message on Haskell'. I posed this as a general
issue.
In special cases like
Anthony Clayden wrote:
Better still, given that there is a mechanical way to convert FunDeps to
equalities, we could start treating the FunDep on a class declaration as
documentation, and validate that the instances observe the mechanical
translation.
I think this mechanical way is not
Wren Thornton wrote:
So I'm processing a large XML file which is a database of about 170k
entries, each of which is a reasonable enough size on its own, and I only
need streaming access to the database (basically printing out summary data
for each entry). Excellent, sounds like a job for SAX.
Aleksandar Dimitrov wrote:
I've been kicking around the idea of re-implementing HList on the basis of the
new DataKinds [1] extension.
The current HList already uses DataKinds (and GADTs), to the extent
possible with GHC 7.4 (GHC 7.6 supports the kind polymorphism better, but
it had a critical
Timon Gehr wrote:
I am not sure that the two statements are equivalent. Above you say that
the context distinguishes x == y from y == x and below you say that it
distinguishes them in one possible run.
I guess this is a terminological problem. The phrase `context
distinguishes e1 and e2' is
Lazy I/O *sounds* safe.
And most of the alternatives (like conduits) hurt my head,
so it is really *really* tempting to stay with lazy I/O and
think I'm doing something safe.
Well, conduit was created for the sake of a web framework. I think all
web frameworks, in whatever language, are
One problem with such monad implementations is efficiency. Let's define
step :: (MonadPlus m) = Int - m Int
step i = choose [i, i + 1]
-- repeated application of step on 0:
stepN :: (Monad m) = Int - m (S.Set Int)
stepN = runSet . f
where
f 0 = return 0
The question of Set monad comes up quite regularly, most recently at
http://www.ittc.ku.edu/csdlblog/?p=134
Indeed, we cannot make Data.Set.Set to be the instance of Monad type
class -- not immediately, that it. That does not mean that there is no
Set Monad, a non-determinism monad that
One may read this message as proving True === False without resorting
to IO. In other words, referential transparency, or the substitution
of equals for equals, may fail even in expressions of type Bool.
This message is intended as an indirect stab at lazy IO.
Unfortunately, Lazy IO and even
Henning Thielemann wrote:
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:
You might like the following message
Wren Thornton wrote:
I had some similar issues recently. The trick is figuring out how to
convince attoparsec to commit to a particular alternative. For example,
consider the grammar: A (B A)* C; where if the B succeeds then we want to
commit to parsing an A (and if it fails then return A's
Jeremy Shaw wrote:
It would be pretty damn cool if you could create a data type for
generically describing a monadic parser, and then use template haskell
to generate a concrete parser from that data type. That would allow
you to create your specification in a generic way and then target
Dmitry Kulagin wrote:
I try to implement typed C-like structures in my little dsl.
HList essentially had those
http://code.haskell.org/HList/
I was unable to implement required type function:
type family Find (s :: Symbol) (xs :: [(Symbol,Ty)]) :: Ty
Which just finds a type in a
Tom Ellis wrote:
To avoid retaining a large lazy data structure in memory it is useful to
hide it behind a function call. Below, many is used twice. It is hidden
behind a function call so it can be garbage collected between uses.
As you discovered, it is quite challenging to ``go against
It is indeed true that a grammar with left-recursion can be
transformed to an equivalent grammar without left recursion --
equivalent in terms of the language recognized -- but _not_ in the
parse trees. Linguists in particular care about parses. Therefore, it was
linguists who developed the
That said, to express foldl via foldr, we need a higher-order
fold. There are various problems with higher-order folds, related to
the cost of building closures. The problems are especially severe
in strict languages or strict contexts. Indeed,
foldl_via_foldr f z l = foldr (\e a z
As others have pointed out, _in principle_, foldr is not at all
deficient. We can, for example, express foldl via foldr. Moreover, we
can express head, tail, take, drop and even zipWith through
foldr. That is, the entire list processing library can be written in
terms of foldr:
Dmitry Kulagin wrote:
I try to implement little typed DSL with functions, but there is a problem:
compiler is unable to infer type for my functions.
One way to avoid the problem is to start with the tagless final
representation. It imposes fewer requirements on the type system, and
is a quite
Petr Pudlak wrote:
could somebody recommend me study materials for learning Hindley-Milner
type inference algorithm I could recommend to undergraduate students?
Perhaps you might like a two-lecture course for undergraduates, which
uses Haskell throughout
Magiclouds asked how to build values of data types with many
components from a list of components. For example, suppose we have
data D3 = D3 Int Int Int deriving Show
v3 = [1::Int,2,3]
How can we build the value D3 1 2 3 using the list v3 as the source
for D3's fields? We can't
Johan Tibell posed an interesting problem of incremental XML parsing
while still detecting and reporting ill-formedness errors.
What you can't have (I think) is a function:
decode :: FromJSON a = ByteString - Maybe a
and constant-memory parsing at the same time. The return type here
I am doing, for several months, constant-space processing of large XML
files using iteratees. The file contains many XML elements (which are
a bit complex than a number). An element can be processed
independently. After the parser finished with one element, and dumped
the related data, the
Alex Stangl posed a problem of trying to efficiently memoize a
function without causing divergence:
solve = let a :: Array Int Int
a = listArray (0, 3) (0 : f 0)
f k = if k 0
then f (a!0)
else 0 : f 1
in (intercalate
Alex Stangl wrote:
To make this concrete, here is the real solve function, which computes
a border array (Knuth-Morris-Pratt failure function) for a specified
string, before the broken memoization modification is made:
solve :: String - String
solve w = let h = length w - 1
Takayuki Muranushi wrote:
Today, I encountered a strange trouble with higher-rank polymorphism. It
was finally solved by nominal typing. Was it a bug in type checker? lack of
power in type inference?
runDB :: Lens NetworkState RIB
runDB = lens (f::NetworkState - RIB) (\x s - s { _runDB = x
And HList paper left me with two questions. The first one is how much
such an encoding costs both in terms of speed and space. And the
second one is can I conveniently define a Storable instance for
hlists. As I said before, I need all this machinery to parse a great
number of serialized
Andreas Abel wrote:
I tell them that monads are for sequencing effects; and the
sequencing is visible clearly in
() :: IO a - IO b - IO b
(=) :: IO a - (a - IO b) - IO b
but not in
fmap :: (a - b) - IO a - IO b
join :: IO (IO a) - IO a
Indeed! I'd like to point out an old
I was playing with the classic example of a Foldable structure: Trees.
So the code you can find both on Haskell Wiki and LYAH is the following:
data Tree a = Empty | Node (Tree a) a (Tree a) deriving (Show, Eq)
instance Foldable Tree where
foldMap f Empty = mempty
foldMap f (Node
First of all, MigMit has probably suggested the parameterization of
Like by the constraint, something like the following:
data Like ctx = forall a. (ctx a, Typeable a) = Like a
instance ALike (Like ALike) where
toA (Like x) = toA x
instance CLike (Like CLike) where
toC (Like x) = toC x
Sorry for a late reply.
There are of course more total functions of type `[a]^n - [a]` than of type
`[a] - [a]`, in the sense that any term of the latter type can be assigned
the
former type. But, on the other hand, any total function `f :: [a]^n - [a]`
has an equivalent total function
Wouldn't you say then that Church encoding is still the more appropriate
reference given that Boehm-Berarducci's algorithm is rarely used?
When I need to encode pattern matching it's goodbye Church and hello Scott.
Aside from your projects, where else is the B-B procedure used?
First of
do you have any references for the extension of lambda-encoding of
data into dependently typed systems?
Is there a way out of this quagmire? Or are we stuck defining actual
datatypes if we want dependent types?
Although not directly answering your question, the following paper
Inductive
Dan Doel wrote:
P.S. It is actually possible to write zip function using Boehm-Berarducci
encoding:
http://okmij.org/ftp/Algorithms.html#zip-folds
If you do, you might want to consider not using the above method, as I
seem to recall it doing an undesirable amount of extra work
There has been a recent discussion of ``Church encoding'' of lists and
the comparison with Scott encoding.
I'd like to point out that what is often called Church encoding is
actually Boehm-Berarducci encoding. That is, often seen
newtype ChurchList a =
CL { cataCL :: forall r. (a - r - r)
Florian Lorenzen wrote:
Now, I'd like to have a function
typecheck :: Exp - Maybe (Term t)
typecheck exp = ...
that returns the GADT value corresponding to `exp' if `exp' is type
correct.
Let us examine that type:
typecheck :: forall t. Exp - Maybe (Term t)
Do you really mean
I am currently trying to rewrite the Graphics.Pgm library from hackage
to parse the PGM to a lazy array.
Laziness and IO really do not mix.
The problem is that even using a lazy array structure, because the
parser returns an Either structure it is only possible to know if the
parser was
Corentin Dupon wrote about essentially the read-show problem:
class (Typeable e) = Event e
data Player = Player Int deriving (Typeable)
data Message m = Message String deriving (Typeable)
instance Event Player
instance (Typeable m) = Event (Message m)
viewEvent ::
Let me see if I understand. You have events of different sorts: events
about players, events about timeouts, events about various
messages. Associated with each sort of event is a (potentially open)
set of data types: messages can carry payload of various types. A
handler specifies behavior of a
Matthew Steele asked why foo type-checks and bar doesn't:
class FooClass a where ...
foo :: (forall a. (FooClass a) = a - Int) - Bool
foo fn = ...
newtype IntFn a = IntFn (a - Int)
bar :: (forall a. (FooClass a) = IntFn a) - Bool
bar (IntFn fn) = foo fn
This and further
Consider code, that takes input from handle until special substring matched:
matchInf a res s | a `isPrefixOf` s = reverse res
matchInf a res (c:cs) = matchInf a (c:res) cs
hTakeWhileNotFound str hdl = hGetContents hdl = return.matchInf str []
It is simple, but the
It's only a test case. The real thing is for a game and will be
something like:
class EntityT e where
update :: e - e
render :: e - IO ()
handleEvent :: e - Event - e
getBound:: e - Maybe Bound
data Entity = forall e. (EntityT e) = Entity e
data Level = Level
Anthony Clayden wrote:
So three questions in light of the approach of abandoning FunDeps and
therefore not getting interference with overlapping:
A. Does TTypeable need to be so complicated?
B. Is TTypeable needed at all?
C. Does the 'simplistic' version of type equality testing suffer
Timo von Holtz wrote:
class Test a where
foo :: Monad m = m a
instance Num a = Test a where
foo = return 1
instance Test Int where
foo = return 2
test constr = fromConstrM foo constr
I'm afraid the type checker is right. From the type of fromConstrM
fromConstrM :: forall m a.
data A = A deriving Show
data B = B deriving Show
data C = C deriving Show
data Foo = forall a. Show a = MkFoo a (Int - Bool)
instance Show Foo where
show (MkFoo a f) = show a
I'd like to point out that the only operation we can do on the first
argument of MkFoo is to show to it. This
System/Posix/DynamicLinker/Module/ByteString.hsc and
System/Posix/DynamicLinker/Prim.hsc sources in unix-2.5.1.0 package
contains the following reference to GPL-2 c2hs package:
-- Derived from GModule.chs by M.Weber M.Chakravarty which is part of
c2hs
-- I left the API more or less the same,
I think instead you should have:
- abandoned FunDeps
- embraced Overlapping more!
Well, using TypeCast to emulate all FunDeps was demonstrated three
years later after HList (or even sooner -- I don't remember when
exactly the code was written):
did you see this, and the discussion around that time?
http://www.haskell.org/pipermail/haskell-prime/2012-May/003688.html
I implemented hDeleteMany without FunDeps -- and it works in Hugs (using
TypeCast -- but looks prettier in GHC with equality constraints).
I'm afraid I didn't see that
Ryan Ingram wrote:
I've been seeing this pattern in a surprising number of instance
definitions lately:
instance (a ~ ar, b ~ br) = Mcomp a ar b br [1]
instance (b ~ c, CanFilterFunc b a) = CanFilter (b - c) a [2]
And here are a few more earlier instances of the same occurrence:
However, if your are using ExtendedDefaultRules then you are likely to
know you are leaving the clean sound world of type inference.
First of all, ExtendedDefaultRules is enabled by default in
GHCi. Second, my example will work without ExtendedDefaultRules, in
pure Haskell98. It is even
http://en.pk.paraiso-lang.org/Haskell/Monad-Gaussian
What do you think? Will this be a good approach or bad?
I don't think it is a Monad (or even restricted monad, see
below). Suppose G a is a `Gaussian' monad and n :: G Double is a
random number with the Gaussian (Normal distribution). Then
Exercise: how does the approach in the code relate to the approaches
to sharing explained in
http://okmij.org/ftp/tagless-final/sharing/sharing.html
Chapter 3 introduces an implicit impure counter, and Chapter 4 uses a
database that is passed around.
let_ in Chapter 5 of
1. Haskell's type inference is NON-COMPOSITIONAL!
Yes, it is -- and there are many examples of it. Here is an example
which has nothing to do with MonomorphismRestriction or numeric
literals
{-# LANGUAGE ExtendedDefaultRules #-}
class C a where
m :: a - Int
instance C () where
m _
The bad news is that indeed you don't seem to be able to do what you
want. The good news: yes, you can. The enclosed code does exactly what
you wanted:
sunPerMars :: NonDet Double
sunPerMars = (/) $ sunMass * marsMass
sunPerMars_run = runShare sunPerMars
sunPerMars_run_len = length
Tillmann Rendel has correctly noted that the source of the problem is
the correlation among the random variables. Specifically, our
measurement of Sun's mass and of Mars mass used the same rather than
independently drawn samples of the Earth mass. Sharing (which
supports what Functional-Logic
And yes to first order predicate calculus too!
Just two weeks ago Chung-chieh Shan and I were explaining at NASSLLI
the embedding in Haskell of the higher-order predicate logic with two
base types (so-called Ty2). The embedding supports type-safe
simplification of formulas (which was really
Do you know why they switched over in GHC 6.6?
If I were to speculate, I'd say it is related to GADTs. Before GADTs,
we can keep conflating quantified type variables with schematic type
variables. GADTs seem to force us to make the distinction.
Consider this code:
data G a where
GI :: Int
Kangyuan Niu wrote:
Aren't both Haskell and SML translatable into System F, from which
type-lambda is directly taken?
The fact that both Haskell and SML are translatable to System F does
not imply that Haskell and SML are just as expressive as System
F. Although SML (and now OCaml) does have
Nicolas Trangez wrote
The protocol I'd like to implement is different: it's long-running using
repeated requests responses on a single client connection. Basically,
a client connects and sends some data to the server (where the length of
this data is encoded in the header). Now the server
Yves Pare`s wrote:
So I'm trying to make a type level function to test if a type list contains
a type. Unless I'm wrong, that calls to the use of a type family.
More crucially, list membership also calls for an equality
predicate. Recall, List.elem has the Eq constraint; so the type-level
i think what i will do is to instantiate all table types individually:
| instance Show c = Show (SimpleTable c) where
| showsPrec p t = showParen (p 10) $ showString FastTable .
| shows (toLists t)
I was going to propose this solution, as well as
| instance (Table a c, Show c) = Show a where
I would have thought that there is on overlap: the instance in my code
above defines how to show a table if the cell is showable;
No, the instance defines how to show values of any type; that type
must be an instance of Table. There is no `if'
Victor Miller wrote:
I was writing a Haskell program which builds a large labeled binary tree
and then does some processing of it, which is fold-like. In the actual
application that I have in mind the tree will be *huge*. If the whole tree
is kept in memory it would probably take up 100's
1 - 100 of 588 matches
Mail list logo