polymorphic-functions Questions

5

Solved

Here's a function polymorphic in 3 types: :t (.) (.) :: (b -> c) -> (a -> b) -> a -> c and here a non polymorphic function: :t Data.Char.digitToInt Data.Char.digitToInt :: Char -&gt...

2

I do not see the bug in this implementation: CREATE FUNCTION foo(anyelement) RETURNS SETOF int AS $f$ SELECT id FROM unnest(array[1,2,3]) t(id) WHERE CASE WHEN (pg_typeof($1)::text)='integer' T...
Tripper asked 16/3, 2016 at 2:40

1

Solved

For example, how can I write a version of map that will work with polymorphic functions in Typed Racket? I use a simple id function defined as: (: id : (All (A) A -> A)) (define (id x) x) Whe...

3

Solved

In the book Functional Programming in Scala MEAP v10, the author mentions Polymorphic functions are often so constrained by their type that they only have one implementation! and gives the exa...
Lytta asked 25/9, 2014 at 7:13

1

Solved

I have this situation (stripped down to the essential parts) class Foo[L <: HList](columns: L) { class toRecord(row: Row) extends Poly1 { implicit def caseColumn[T] = at[Column[T]] { /* map ...
Miscarry asked 13/8, 2014 at 14:26
1

© 2022 - 2024 — McMap. All rights reserved.