[personal profile] sassa_nf
Prelude> let it f xs = ys where (ys, fs) = unzip $ zipWith ($) (f:fs) xs

<interactive>:3:35:
    Occurs check: cannot construct the infinite type:
      b0 = b1 -> (a0, b0)


Рекурсию решить может, а вот такое - нет. Как дальше жить? :)

Date: 2013-06-03 04:53 pm (UTC)
From: [identity profile] deni-ok.livejournal.com
А зачем такой тип нужен, какой у него смысл? Ну решим мы эту рекурсию через неподвижную точку для типов
data Mu f = In (f (Mu f))

data Bx b1 a0 x = Bx (b1 -> (a0, x))
  
type B0 b1 a0 = Mu (Bx b1 a0)
А дальше что?

Date: 2013-06-03 05:47 pm (UTC)
From: [identity profile] sassa-nf.livejournal.com
а это я по мотивам поста про Iteratee. По сути Iteratee в изложении rssh генерируют вот такую вот цепочку fs для xs. Я попытался использовать трюк, выражающий unfoldr через zipWith, но вот с выводом типа получилась беда.

Date: 2013-06-03 07:17 pm (UTC)
From: [identity profile] the-drmad.livejournal.com
Не, "так жить нельзя" (с) :)

З.Ы. Про буку слахать? Чета в этом борделе всю весну какая-то жють твориццо: http://www.ntv.ru/novosti/592616/

Date: 2013-06-04 08:41 am (UTC)
From: [identity profile] sassa-nf.livejournal.com
поспрашиваю.

фигасе у вас беспределы.

Profile

sassa_nf

February 2026

S M T W T F S
1234567
891011121314
15161718192021
222324252627 28

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 22nd, 2026 09:19 pm
Powered by Dreamwidth Studios