fixpoint-combinators Questions

3

Solved

Every time I’ve used fix :: (a -> a) -> a, it’s been at the type ((a -> b) -> a -> b) -> a -> b for some a and b. Is there actually some application of fix where its type pa...
Wines asked 20/1, 2015 at 1:8

2

Solved

A list in Haskell might look like this: data List a = Nil | Cons a (List a) A type theoretic interpretation is: λα.μβ.1+αβ which encodes the list type as the fixed point of a functor. In Hask...

4

I recently learned about Data.Function.fix, and now I want to apply it everywhere. For example, whenever I see a recursive function I want to "fix" it. So basically my question is where and when sh...
Explicative asked 10/2, 2014 at 21:15

1

Solved

After reading Milewski's F-algebra article, I tried to implement it and use for a real-world problem. However, I can't seem to figure out how to write instances for Fix, newtype Fix f = Fx { unFix...

2

Solved

I am new to the world of fixed-point combinators and I guess they are used to recurse on anonymous lambdas, but I haven't really got to use them, or even been able to wrap my head around them compl...

3

Is there a fixed point combinator for creating tuples of mutually recursive functions? I.e. I'm looking for something like the Y-Combinator but which takes multiple "recursive"* functions, and will...

2

Solved

>>>flip fix (0 :: Int) (\a b -> putStrLn "abc") Output: "abc" This is a simplified version of using flip fix. I saw this way of using it in some youtube video which are probably from ...
Cahier asked 20/3, 2013 at 12:7

2

Solved

I have a function which computes a fixed point in terms of iterate: equivalenceClosure :: (Ord a) => Relation a -> Relation a equivalenceClosure = fst . List.head -- "guaranteed" to exist ...
Audriaaudrie asked 9/6, 2011 at 22:52

4

Solved

Looking at the GHC source code I can see that the definition for fix is: fix :: (a -> a) -> a fix f = let x = f x in x In an example fix is used like this: fix (\f x -> let x' = x+1 in...
Tunisia asked 21/10, 2012 at 15:46

2

How can the following data type from Haskell be expressed in OCaml or SML? newtype Fix f = In (f (Fix f))
Diction asked 21/10, 2012 at 4:43

5

Solved

The fixed point combinator doesn't always produce the right answer given the definition: fix f = f (fix f) The following code does not terminate: fix (\x->x*x) 0 Of course, fix can't alway...
Stretch asked 11/11, 2011 at 20:9

1

Solved

I'm looking for a library that will compute the fixed point / closure of a set under a number of operators of variable arity. For example, fixwith [(+)] [1] for the integers should compute all o...
Jimmie asked 30/8, 2011 at 23:12

© 2022 - 2024 — McMap. All rights reserved.