Guest User

Untitled

a guest
Apr 20th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Oz 0.73 KB | None | 0 0
  1. %<LList T>::=lNil|lCons(T({}-><LList T>))
  2.  
  3. declare fun {ToLazyList L}
  4.        case L of
  5.           H|T then lCons(H fun{$} {ToLazyList T} end)
  6.        [] nil then lNil
  7.        end
  8.     end
  9.  
  10. declare fun {Split Podzial#Lista}
  11.             case Lista of
  12.                lNil then lNil
  13.             [] lCons(H T) then case {Podzial H} of
  14.                       true then lCons(H fun{$} {Split Podzial#{T}}end)
  15.                        [] false then {Split Podzial#{T}}
  16.                        end
  17.             end
  18.     end
  19.        
  20.  
  21. declare fun {Podzial1 Y}
  22.        5>Y
  23.     end
  24.  
  25.  
  26. declare fun {LTake LL}
  27.        case LL of
  28.           lNil then nil
  29.        [] lCons(X LT) then X|{LTake {LT}}
  30.        end
  31.     end
  32.  
  33. {Show true}
  34. {Show{Split Podzial1#{ToLazyList [1 2 3 4 5 6 7 8 nil]}}#{LTake {Split (!Podzial1)#{ToLazyList [1 2 3 4 5 6 7 8 nil]}}}}
Add Comment
Please, Sign In to add comment