Update CoList.idr
Changed to match [Haskell's implementation](https://hackage.haskell.org/package/base-4.9.1.0/docs/Data-List.html#v:unfoldr). This version is strictly more powerful, and it is clearer from the signature what is happening (imho).
commit3d4b36f7e6213853f14babbc049eae3384a4a1b4
authorSynthetica9 <patrickhilhorst97@gmail.com>
dateWed 10 May 2017, 23:17 (9 years ago)
parentfcbabc2
libs/contrib/Data/CoList.idr+1−1
@@ -47,7 +47,7 @@ takeCo (S n) (x::xs) = x :: takeCo n xs
4747||| unfoldr (\b => if b == 0 then Nothing else Just (b, b-1)) 10
4848||| ```
4949|||
50−unfoldr : (a -> Maybe (a, a)) -> a -> CoList a
50+unfoldr : (a -> Maybe (b, a)) -> a -> CoList b
5151unfoldr f x =
5252 case f x of
5353 Just (y, new_x) => y :: (unfoldr f new_x)