Advertisement
logicmoo

Either.curry

Dec 6th, 2018
750
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 28.13 KB | None | 0 0
  1. root@gitlab:/usr/lib/pakcs/lib/.curry/pakcs# cat ../../Either.curry
  2. --- ----------------------------------------------------------------------------
  3. --- Library with some useful operations for the `Either` data type.
  4. ---
  5. --- @author   Bjoern Peemoeller
  6. --- @version  March 2015
  7. --- @category general
  8. --- ----------------------------------------------------------------------------
  9. {-# OPTIONS_CYMAKE -Wno-incomplete-patterns #-}
  10. module Either
  11.   ( Either (..)
  12.   , either
  13.   , lefts
  14.   , rights
  15.   , isLeft
  16.   , isRight
  17.   , fromLeft
  18.   , fromRight
  19.   , partitionEithers
  20.   ) where
  21.  
  22. --- Extracts from a list of `Either` all the `Left` elements in order.
  23. lefts   :: [Either a b] -> [a]
  24. lefts x = [a | Left a <- x]
  25.  
  26. --- Extracts from a list of `Either` all the `Right` elements in order.
  27. rights   :: [Either a b] -> [b]
  28. rights x = [a | Right a <- x]
  29.  
  30. --- Return `True` if the given value is a `Left`-value, `False` otherwise.
  31. isLeft :: Either a b -> Bool
  32. isLeft (Left  _) = True
  33. isLeft (Right _) = False
  34.  
  35. --- Return `True` if the given value is a `Right`-value, `False` otherwise.
  36. isRight :: Either a b -> Bool
  37. isRight (Left  _) = False
  38. isRight (Right _) = True
  39.  
  40. --- Extract the value from a `Left` constructor.
  41. fromLeft :: Either a _ -> a
  42. fromLeft (Left x) = x
  43.  
  44. --- Extract the value from a `Right` constructor.
  45. fromRight :: Either _ b -> b
  46. fromRight (Right x) = x
  47.  
  48. --- Partitions a list of `Either` into two lists.
  49. --- All the `Left` elements are extracted, in order, to the first
  50. --- component of the output.  Similarly the `Right` elements are extracted
  51. --- to the second component of the output.
  52. partitionEithers :: [Either a b] -> ([a],[b])
  53. partitionEithers = foldr (either left right) ([],[])
  54.  where
  55.   left  a (l, r) = (a:l, r)
  56.   right a (l, r) = (l, a:r)
  57. root@gitlab:/usr/lib/pakcs/lib/.curry/pakcs#
  58. root@gitlab:/usr/lib/pakcs/lib/.curry/pakcs#
  59. root@gitlab:/usr/lib/pakcs/lib/.curry/pakcs#
  60. root@gitlab:/usr/lib/pakcs/lib/.curry/pakcs#
  61. root@gitlab:/usr/lib/pakcs/lib/.curry/pakcs#
  62. root@gitlab:/usr/lib/pakcs/lib/.curry/pakcs# cat Either.pl
  63. %PAKCS2.0 swi7 VARIABLESHARING
  64.  
  65. :-noSingletonWarnings.
  66. :-noRedefineWarnings.
  67. :-noDiscontiguousWarnings.
  68.  
  69. :-importModule('Prelude').
  70.  
  71. :-curryModule('Either').
  72.  
  73.  
  74. %%%%%%%%%%%% function types %%%%%%%%%%%%%%%%%%%
  75. :-multifile functiontype/6.
  76. :-dynamic functiontype/6.
  77. functiontype('Either.lefts',lefts,1,'Either.lefts',nofix,'FuncType'('TCons'([],['TCons'('Prelude.Either',[_2644850,_2644868])]),'TCons'([],[_2644850]))).
  78. functiontype('Either.lefts._\'23lambda3','Either.lefts._#lambda3',2,'Either.lefts._\'23lambda3',nofix,'FuncType'('TCons'('Prelude.Either',[_2678808,_2678826]),'FuncType'('TCons'([],[_2678808]),'TCons'([],[_2678808])))).
  79. functiontype('Either.rights',rights,1,'Either.rights',nofix,'FuncType'('TCons'([],['TCons'('Prelude.Either',[_2712688,_2712706])]),'TCons'([],[_2712706]))).
  80. functiontype('Either.rights._\'23lambda7','Either.rights._#lambda7',2,'Either.rights._\'23lambda7',nofix,'FuncType'('TCons'('Prelude.Either',[_2746652,_2746670]),'FuncType'('TCons'([],[_2746670]),'TCons'([],[_2746670])))).
  81. functiontype('Either.isLeft',isLeft,1,'Either.isLeft',nofix,'FuncType'('TCons'('Prelude.Either',[_2780520,_2780538]),'TCons'('Prelude.Bool',[]))).
  82. functiontype('Either.isRight',isRight,1,'Either.isRight',nofix,'FuncType'('TCons'('Prelude.Either',[_2814484,_2814502]),'TCons'('Prelude.Bool',[]))).
  83. functiontype('Either.fromLeft',fromLeft,1,'Either.fromLeft',nofix,'FuncType'('TCons'('Prelude.Either',[_2848360,_2848472]),_2848360)).
  84. functiontype('Either.fromRight',fromRight,1,'Either.fromRight',nofix,'FuncType'('TCons'('Prelude.Either',[_2882352,_2882258]),_2882258)).
  85. functiontype('Either.partitionEithers',partitionEithers,0,'Either.partitionEithers',nofix,'FuncType'('TCons'([],['TCons'('Prelude.Either',[_2916304,_2916322])]),'TCons'('Prelude.(,)',['TCons'([],[_2916304]),'TCons'([],[_2916322])]))).
  86. functiontype('Either.partitionEithers.left.24','Either.partitionEithers.left.24',2,'Either.partitionEithers.left.24',nofix,'FuncType'(_2950292,'FuncType'('TCons'('Prelude.(,)',['TCons'([],[_2950292]),_2950394]),'TCons'('Prelude.(,)',['TCons'([],[_2950292]),_2950394])))).
  87. functiontype('Either.partitionEithers.right.24','Either.partitionEithers.right.24',2,'Either.partitionEithers.right.24',nofix,'FuncType'(_2984316,'FuncType'('TCons'('Prelude.(,)',[_2984400,'TCons'([],[_2984316])]),'TCons'('Prelude.(,)',[_2984400,'TCons'([],[_2984316])])))).
  88.  
  89. %%%%%%%%%%%% constructor types %%%%%%%%%%%%%%%%%%%
  90. :-multifile constructortype/7.
  91. :-dynamic constructortype/7.
  92.  
  93. %%%%%%%%%%%% function definitions %%%%%%%%%%%%%%%%%%%
  94. 'Either.lefts'(_3033212,_3033214,_3033216,_3033218):-freeze(_3033216,'blocked_Either.lefts'(_3033212,_3033214,_3033216,_3033218)).
  95. 'blocked_Either.lefts'(_3033288,_3033542,_3033548,_3033554):-hnf('Prelude.foldr'(partcall(2,'Either.lefts._\'23lambda3',[]),[],_3033288),_3033542,_3033548,_3033554).
  96.  
  97. 'Either.lefts._\'23lambda3'(_3035254,_3035256,_3035258,_3035260,_3035262):-freeze(_3035260,'blocked_Either.lefts._\'23lambda3'(_3035254,_3035256,_3035258,_3035260,_3035262)).
  98. 'blocked_Either.lefts._\'23lambda3'(_3035340,_3035358,_3035948,_3035954,_3035960):-hnf(_3035340,_3037208,_3035954,_3037184),'blocked_Either.lefts._\'23lambda3_1'(_3037208,_3035358,_3035948,_3037184,_3035960).
  99.  
  100. 'blocked_Either.lefts._\'23lambda3_1'(_3037560,_3037562,_3037564,_3037566,_3037568):-freeze(_3037566,freeze(_3037560,'blocked_blocked_Either.lefts._\'23lambda3_1'(_3037560,_3037562,_3037564,_3037566,_3037568))).
  101. 'blocked_blocked_Either.lefts._\'23lambda3_1'('Prelude.Left'(_3035466),_3035358,[_3035466|_3035358],_3037918,_3037918).
  102. 'blocked_blocked_Either.lefts._\'23lambda3_1'('Prelude.Right'(_3035714),_3035358,_3038846,_3038852,_3038858):-!,hnf(_3035358,_3038846,_3038852,_3038858).
  103. 'blocked_blocked_Either.lefts._\'23lambda3_1'('FAIL'(_3039346),_3035358,'FAIL'(_3039346),_3039360,_3039360).
  104.  
  105. 'Either.rights'(_3039990,_3039992,_3039994,_3039996):-freeze(_3039994,'blocked_Either.rights'(_3039990,_3039992,_3039994,_3039996)).
  106. 'blocked_Either.rights'(_3040066,_3040320,_3040326,_3040332):-hnf('Prelude.foldr'(partcall(2,'Either.rights._\'23lambda7',[]),[],_3040066),_3040320,_3040326,_3040332).
  107.  
  108. 'Either.rights._\'23lambda7'(_3042080,_3042082,_3042084,_3042086,_3042088):-freeze(_3042086,'blocked_Either.rights._\'23lambda7'(_3042080,_3042082,_3042084,_3042086,_3042088)).
  109. 'blocked_Either.rights._\'23lambda7'(_3042166,_3042184,_3042780,_3042786,_3042792):-hnf(_3042166,_3044076,_3042786,_3044052),'blocked_Either.rights._\'23lambda7_1'(_3044076,_3042184,_3042780,_3044052,_3042792).
  110.  
  111. 'blocked_Either.rights._\'23lambda7_1'(_3044434,_3044436,_3044438,_3044440,_3044442):-freeze(_3044440,freeze(_3044434,'blocked_blocked_Either.rights._\'23lambda7_1'(_3044434,_3044436,_3044438,_3044440,_3044442))).
  112. 'blocked_blocked_Either.rights._\'23lambda7_1'('Prelude.Right'(_3042292),_3042184,[_3042292|_3042184],_3044804,_3044804).
  113. 'blocked_blocked_Either.rights._\'23lambda7_1'('Prelude.Left'(_3042540),_3042184,_3045726,_3045732,_3045738):-!,hnf(_3042184,_3045726,_3045732,_3045738).
  114. 'blocked_blocked_Either.rights._\'23lambda7_1'('FAIL'(_3046232),_3042184,'FAIL'(_3046232),_3046246,_3046246).
  115.  
  116. 'Either.isLeft'(_3046876,_3046878,_3046880,_3046882):-freeze(_3046880,'blocked_Either.isLeft'(_3046876,_3046878,_3046880,_3046882)).
  117. 'blocked_Either.isLeft'(_3046952,_3047358,_3047364,_3047370):-hnf(_3046952,_3048202,_3047364,_3048184),'blocked_Either.isLeft_1'(_3048202,_3047358,_3048184,_3047370).
  118.  
  119. 'blocked_Either.isLeft_1'(_3048480,_3048482,_3048484,_3048486):-freeze(_3048484,'blocked_blocked_Either.isLeft_1'(_3048480,_3048482,_3048484,_3048486)).
  120. 'blocked_blocked_Either.isLeft_1'('Prelude.Left'(_3047060),'Prelude.True',_3048822,_3048822).
  121. 'blocked_blocked_Either.isLeft_1'('Prelude.Right'(_3047176),'Prelude.False',_3049506,_3049506):-!.
  122. 'blocked_blocked_Either.isLeft_1'('FAIL'(_3049928),'FAIL'(_3049928),_3049942,_3049942):-nonvar(_3049928).
  123.  
  124. 'Either.isRight'(_3050604,_3050606,_3050608,_3050610):-freeze(_3050608,'blocked_Either.isRight'(_3050604,_3050606,_3050608,_3050610)).
  125. 'blocked_Either.isRight'(_3050680,_3051092,_3051098,_3051104):-hnf(_3050680,_3051972,_3051098,_3051954),'blocked_Either.isRight_1'(_3051972,_3051092,_3051954,_3051104).
  126.  
  127. 'blocked_Either.isRight_1'(_3052256,_3052258,_3052260,_3052262):-freeze(_3052260,'blocked_blocked_Either.isRight_1'(_3052256,_3052258,_3052260,_3052262)).
  128. 'blocked_blocked_Either.isRight_1'('Prelude.Left'(_3050788),'Prelude.False',_3052598,_3052598).
  129. 'blocked_blocked_Either.isRight_1'('Prelude.Right'(_3050904),'Prelude.True',_3053294,_3053294):-!.
  130. 'blocked_blocked_Either.isRight_1'('FAIL'(_3053716),'FAIL'(_3053716),_3053730,_3053730):-nonvar(_3053716).
  131.  
  132. 'Either.fromLeft'(_3054428,_3054430,_3054432,_3054434):-freeze(_3054432,'blocked_Either.fromLeft'(_3054428,_3054430,_3054432,_3054434)).
  133. 'blocked_Either.fromLeft'(_3054504,_3055294,_3055300,_3055306):-hnf(_3054504,_3056210,_3055300,_3056192),'blocked_Either.fromLeft_1'(_3056210,_3055294,_3056192,_3055306).
  134.  
  135. 'blocked_Either.fromLeft_1'(_3056500,_3056502,_3056504,_3056506):-freeze(_3056504,'blocked_blocked_Either.fromLeft_1'(_3056500,_3056502,_3056504,_3056506)).
  136. 'blocked_blocked_Either.fromLeft_1'('Prelude.Left'(_3054612),_3056926,_3056932,_3056938):-!,hnf(_3054612,_3056926,_3056932,_3056938).
  137. 'blocked_blocked_Either.fromLeft_1'('Prelude.Right'(_3054714),_3057576,_3057582,_3057588):-!,hnf('Prelude.failure'('Either.fromLeft',['Prelude.Right'(_3054714)]),_3057576,_3057582,_3057588).
  138. 'blocked_blocked_Either.fromLeft_1'('FAIL'(_3058686),'FAIL'(_3058686),_3058700,_3058700).
  139.  
  140. 'Either.fromRight'(_3059430,_3059432,_3059434,_3059436):-freeze(_3059434,'blocked_Either.fromRight'(_3059430,_3059432,_3059434,_3059436)).
  141. 'blocked_Either.fromRight'(_3059506,_3060302,_3060308,_3060314):-hnf(_3059506,_3061254,_3060308,_3061236),'blocked_Either.fromRight_1'(_3061254,_3060302,_3061236,_3060314).
  142.  
  143. 'blocked_Either.fromRight_1'(_3061550,_3061552,_3061554,_3061556):-freeze(_3061554,'blocked_blocked_Either.fromRight_1'(_3061550,_3061552,_3061554,_3061556)).
  144. 'blocked_blocked_Either.fromRight_1'('Prelude.Right'(_3059614),_3061988,_3061994,_3062000):-!,hnf(_3059614,_3061988,_3061994,_3062000).
  145. 'blocked_blocked_Either.fromRight_1'('Prelude.Left'(_3059716),_3062632,_3062638,_3062644):-!,hnf('Prelude.failure'('Either.fromRight',['Prelude.Left'(_3059716)]),_3062632,_3062638,_3062644).
  146. 'blocked_blocked_Either.fromRight_1'('FAIL'(_3063748),'FAIL'(_3063748),_3063762,_3063762).
  147.  
  148. 'Either.partitionEithers'(_3064744,_3064746,_3064748):-freeze(_3064746,'blocked_Either.partitionEithers'(_3064744,_3064746,_3064748)).
  149. 'blocked_Either.partitionEithers'(_3065300,_3065306,_3065312):-hnf(partcall(1,'Prelude.foldr',['Prelude.(,)'([],[]),partcall(1,'Prelude.either',[partcall(2,'Either.partitionEithers.right.24',[]),partcall(2,'Either.partitionEithers.left.24',[])])]),_3065300,_3065306,_3065312).
  150.  
  151. 'Either.partitionEithers.left.24'(_3067992,_3067994,_3067996,_3067998,_3068000):-freeze(_3067998,'blocked_Either.partitionEithers.left.24'(_3067992,_3067994,_3067996,_3067998,_3068000)).
  152. 'blocked_Either.partitionEithers.left.24'(_3068078,_3068096,_3068802,_3068808,_3068814):-hnf(_3068096,_3070314,_3068808,_3070290),'blocked_Either.partitionEithers.left.24_2'(_3070314,_3068078,_3068802,_3070290,_3068814).
  153.  
  154. 'blocked_Either.partitionEithers.left.24_2'(_3070702,_3070704,_3070706,_3070708,_3070710):-freeze(_3070708,'blocked_blocked_Either.partitionEithers.left.24_2'(_3070702,_3070704,_3070706,_3070708,_3070710)).
  155. 'blocked_blocked_Either.partitionEithers.left.24_2'('Prelude.(,)'(_3068204,_3068222),_3068078,'Prelude.(,)'([_3068078|_3068204],_3068222),_3071038,_3071038):-!.
  156. 'blocked_blocked_Either.partitionEithers.left.24_2'('FAIL'(_3072068),_3068078,'FAIL'(_3072068),_3072082,_3072082):-nonvar(_3072068).
  157.  
  158. 'Either.partitionEithers.right.24'(_3073400,_3073402,_3073404,_3073406,_3073408):-freeze(_3073406,'blocked_Either.partitionEithers.right.24'(_3073400,_3073402,_3073404,_3073406,_3073408)).
  159. 'blocked_Either.partitionEithers.right.24'(_3073486,_3073504,_3074216,_3074222,_3074228):-hnf(_3073504,_3075764,_3074222,_3075740),'blocked_Either.partitionEithers.right.24_2'(_3075764,_3073486,_3074216,_3075740,_3074228).
  160.  
  161. 'blocked_Either.partitionEithers.right.24_2'(_3076158,_3076160,_3076162,_3076164,_3076166):-freeze(_3076164,'blocked_blocked_Either.partitionEithers.right.24_2'(_3076158,_3076160,_3076162,_3076164,_3076166)).
  162. 'blocked_blocked_Either.partitionEithers.right.24_2'('Prelude.(,)'(_3073612,_3073630),_3073486,'Prelude.(,)'(_3073612,[_3073486|_3073630]),_3076494,_3076494):-!.
  163. 'blocked_blocked_Either.partitionEithers.right.24_2'('FAIL'(_3077530),_3073486,'FAIL'(_3077530),_3077544,_3077544):-nonvar(_3077530).
  164.  
  165. :-costCenters(['']).
  166.  
  167.  
  168.  
  169.  
  170. %%%%% Number of shared variables: 0
  171. root@gitlab:/usr/lib/pakcs/lib/.curry/pakcs#
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198. Some other random sruff from Prelude.pl
  199.  
  200.  
  201. :-block 'Prelude..'(?,?,?,-,?).
  202. 'Prelude..'(A,B,C,D,E):-hnf(partcall(1,'Prelude..._\'23lambda279',[B,A]),C,D,E).
  203.  
  204. :-block 'Prelude..._\'23lambda279'(?,?,?,?,-,?).
  205. 'Prelude..._\'23lambda279'(A,B,C,D,E,F):-hnf('Prelude.apply'(A,'Prelude.apply'(B,C)),D,E,F).
  206.  
  207. :-block 'Prelude.id'(?,?,-,?).
  208. 'Prelude.id'(A,B,C,D):-hnf(A,B,C,D).
  209.  
  210. :-block 'Prelude.const'(?,?,?,-,?).
  211. 'Prelude.const'(A,B,C,D,E):-hnf(A,C,D,E).
  212.  
  213. :-block 'Prelude.curry'(?,?,?,?,-,?).
  214. 'Prelude.curry'(A,B,C,D,E,F):-hnf('Prelude.apply'(A,'Prelude.(,)'(B,C)),D,E,F).
  215.  
  216. :-block 'Prelude.uncurry'(?,?,?,-,?).
  217. 'Prelude.uncurry'(A,B,C,D,E):-hnf(B,F,D,G),'Prelude.uncurry_2'(F,A,C,G,E).
  218.  
  219. :-block 'Prelude.uncurry_2'(?,?,?,-,?).
  220. 'Prelude.uncurry_2'('Prelude.(,)'(A,B),C,D,E,F):-!,hnf('Prelude.apply'('Prelude.apply'(C,A),B),D,E,F).
  221. 'Prelude.uncurry_2'('FAIL'(A),B,'FAIL'(A),C,C):-nonvar(A).
  222.  
  223. :-block 'Prelude.flip'(?,?,?,?,-,?).
  224. 'Prelude.flip'(A,B,C,D,E,F):-hnf('Prelude.apply'('Prelude.apply'(A,C),B),D,E,F).
  225.  
  226. :-block 'Prelude.until'(?,?,?,?,-,?).
  227. 'Prelude.until'(A,B,C,D,E,F):-makeShare(A,G),makeShare(C,H),hnf('Prelude.apply'(G,H),I,E,J),'Prelude.until_ComplexCase'(I,G,B,H,D,J,F).
  228.  
  229. :-block 'Prelude.until_ComplexCase'(-,?,?,?,?,?,?),'Prelude.until_ComplexCase'(?,?,?,?,?,-,?).
  230. 'Prelude.until_ComplexCase'('Prelude.True',A,B,C,D,E,F):-hnf(C,D,E,F).
  231. 'Prelude.until_ComplexCase'('Prelude.False',A,B,C,D,E,F):-!,makeShare(B,G),hnf('Prelude.until'(A,G,'Prelude.apply'(G,C)),D,E,F).
  232. 'Prelude.until_ComplexCase'('FAIL'(A),B,C,D,'FAIL'(A),E,E).
  233.  
  234. :-block 'Prelude.ensureSpine'(?,?,-,?).
  235. 'Prelude.ensureSpine'(A,B,C,D):-hnf('Prelude.ensureSpine.ensureList.20'('Prelude.ensureNotFree'(A)),B,C,D).
  236.  
  237. :-block 'Prelude.ensureSpine.ensureList.20'(?,?,-,?).
  238. 'Prelude.ensureSpine.ensureList.20'(A,B,C,D):-hnf(A,E,C,F),'Prelude.ensureSpine.ensureList.20_1'(E,B,F,D).
  239.  
  240. :-block 'Prelude.ensureSpine.ensureList.20_1'(?,?,-,?).
  241. 'Prelude.ensureSpine.ensureList.20_1'([],[],A,A).
  242. 'Prelude.ensureSpine.ensureList.20_1'([A|B],[A|'Prelude.ensureSpine'(B)],C,C):-!.
  243. 'Prelude.ensureSpine.ensureList.20_1'('FAIL'(A),'FAIL'(A),B,B):-nonvar(A).
  244.  
  245. :-block 'Prelude.$'(?,?,?,-,?).
  246. 'Prelude.$'(A,B,C,D,E):-hnf('Prelude.apply'(A,B),C,D,E).
  247.  
  248. :-block 'Prelude.error'(?,?,-,?).
  249. 'Prelude.error'(A,B,C,D):-hnf('Prelude.$##'(partcall(1,'Prelude.prim_error',[]),A),B,C,D).
  250.  
  251. :-block 'Prelude.prim_error'(?,?,-,?).
  252. 'Prelude.prim_error'(A,B,C,D):-derefAll(A,E),prim_error(E,B),C=D.
  253.  
  254. :-block 'Prelude.&&'(?,?,?,-,?).
  255. 'Prelude.&&'(A,B,C,D,E):-hnf(A,F,D,G),'Prelude.&&_1'(F,B,C,G,E).
  256.  
  257. :-block 'Prelude.&&_1'(?,?,?,-,?).
  258. 'Prelude.&&_1'('Prelude.True',A,B,C,D):-hnf(A,B,C,D).
  259. 'Prelude.&&_1'('Prelude.False',A,'Prelude.False',B,B):-!.
  260. 'Prelude.&&_1'('FAIL'(A),B,'FAIL'(A),C,C):-nonvar(A).
  261.  
  262. :-block 'Prelude.||'(?,?,?,-,?).
  263. 'Prelude.||'(A,B,C,D,E):-hnf(A,F,D,G),'Prelude.||_1'(F,B,C,G,E).
  264.  
  265. :-block 'Prelude.||_1'(?,?,?,-,?).
  266. 'Prelude.||_1'('Prelude.True',A,'Prelude.True',B,B).
  267. 'Prelude.||_1'('Prelude.False',A,B,C,D):-!,hnf(A,B,C,D).
  268. 'Prelude.||_1'('FAIL'(A),B,'FAIL'(A),C,C):-nonvar(A).
  269.  
  270. :-block 'Prelude.not'(?,?,-,?).
  271. 'Prelude.not'(A,B,C,D):-hnf(A,E,C,F),'Prelude.not_1'(E,B,F,D).
  272.  
  273. :-block 'Prelude.not_1'(?,?,-,?).
  274. 'Prelude.not_1'('Prelude.True','Prelude.False',A,A).
  275. 'Prelude.not_1'('Prelude.False','Prelude.True',A,A):-!.
  276. 'Prelude.not_1'('FAIL'(A),'FAIL'(A),B,B):-nonvar(A).
  277.  
  278. :-block 'Prelude.otherwise'(?,-,?).
  279. 'Prelude.otherwise'('Prelude.True',A,A).
  280.  
  281. :-block 'Prelude.if_then_else'(?,?,?,?,-,?).
  282. 'Prelude.if_then_else'(A,B,C,D,E,F):-hnf(A,G,E,H),'Prelude.if_then_else_1'(G,B,C,D,H,F).
  283.  
  284. :-block 'Prelude.if_then_else_1'(-,?,?,?,?,?),'Prelude.if_then_else_1'(?,?,?,?,-,?).
  285. 'Prelude.if_then_else_1'('Prelude.True',A,B,C,D,E):-hnf(A,C,D,E).
  286. 'Prelude.if_then_else_1'('Prelude.False',A,B,C,D,E):-!,hnf(B,C,D,E).
  287. 'Prelude.if_then_else_1'('FAIL'(A),B,C,'FAIL'(A),D,D).
  288.  
  289. :-block 'Prelude.solve'(?,?,-,?).
  290. 'Prelude.solve'(A,B,C,D):-hnf(A,E,C,F),'Prelude.solve_1'(E,B,F,D).
  291.  
  292. :-block 'Prelude.solve_1'(?,?,-,?).
  293. 'Prelude.solve_1'('Prelude.True','Prelude.True',A,A):-!.
  294. 'Prelude.solve_1'('Prelude.False',A,B,C):-!,hnf('Prelude.failure'('Prelude.solve',['Prelude.False']),A,B,C).
  295. 'Prelude.solve_1'('FAIL'(A),'FAIL'(A),B,B).
  296.  
  297. :-block 'Prelude.&>'(?,?,?,-,?).
  298. 'Prelude.&>'(A,B,C,D,E):-hnf(A,F,D,G),'Prelude.&>_1'(F,B,C,G,E).
  299.  
  300. :-block 'Prelude.&>_1'(?,?,?,-,?).
  301. 'Prelude.&>_1'('Prelude.True',A,B,C,D):-!,hnf(A,B,C,D).
  302. 'Prelude.&>_1'('Prelude.False',A,B,C,D):-!,hnf('Prelude.failure'('Prelude.&>',['Prelude.False']),B,C,D).
  303. 'Prelude.&>_1'('FAIL'(A),B,'FAIL'(A),C,C).
  304.  
  305. :-block 'Prelude.eqChar'(?,?,?,-,?).
  306. 'Prelude.eqChar'(A,B,C,D,E):-hnf('Prelude.$#'('Prelude.$#'(partcall(2,'Prelude.prim_eqChar',[]),B),A),C,D,E).
  307.  
  308. :-block 'Prelude.prim_eqChar'(?,?,?,-,?).
  309. 'Prelude.prim_eqChar'(A,B,C,D,E):-derefRoot(A,F),derefRoot(B,G),prim_eqBasic(F,G,C),D=E.
  310.  
  311. :-block 'Prelude.eqInt'(?,?,?,-,?).
  312. 'Prelude.eqInt'(A,B,C,D,E):-hnf('Prelude.$#'('Prelude.$#'(partcall(2,'Prelude.prim_eqInt',[]),B),A),C,D,E).
  313.  
  314. :-block 'Prelude.prim_eqInt'(?,?,?,-,?).
  315. 'Prelude.prim_eqInt'(A,B,C,D,E):-derefRoot(A,F),derefRoot(B,G),prim_eqBasic(F,G,C),D=E.
  316.  
  317. :-block 'Prelude.eqFloat'(?,?,?,-,?).
  318. 'Prelude.eqFloat'(A,B,C,D,E):-hnf('Prelude.$#'('Prelude.$#'(partcall(2,'Prelude.prim_eqFloat',[]),B),A),C,D,E).
  319.  
  320. :-block 'Prelude.prim_eqFloat'(?,?,?,-,?).
  321. 'Prelude.prim_eqFloat'(A,B,C,D,E):-derefRoot(A,F),derefRoot(B,G),prim_eqBasic(F,G,C),D=E.
  322.  
  323. :-block 'Prelude.ltEqChar'(?,?,?,-,?).
  324. 'Prelude.ltEqChar'(A,B,C,D,E):-hnf('Prelude.$#'('Prelude.$#'(partcall(2,'Prelude.prim_ltEqChar',[]),B),A),C,D,E).
  325.  
  326. :-block 'Prelude.prim_ltEqChar'(?,?,?,-,?).
  327. 'Prelude.prim_ltEqChar'(A,B,C,D,E):-derefRoot(A,F),derefRoot(B,G),prim_leqChar(F,G,C),D=E.
  328.  
  329. :-block 'Prelude.ltEqInt'(?,?,?,-,?).
  330. 'Prelude.ltEqInt'(A,B,C,D,E):-hnf('Prelude.$#'('Prelude.$#'(partcall(2,'Prelude.prim_ltEqInt',[]),B),A),C,D,E).
  331.  
  332. :-block 'Prelude.prim_ltEqInt'(?,?,?,-,?).
  333. 'Prelude.prim_ltEqInt'(A,B,C,D,E):-derefRoot(A,F),derefRoot(B,G),prim_leqNumber(F,G,C),D=E.
  334.  
  335. :-block 'Prelude.ltEqFloat'(?,?,?,-,?).
  336. 'Prelude.ltEqFloat'(A,B,C,D,E):-hnf('Prelude.$#'('Prelude.$#'(partcall(2,'Prelude.prim_ltEqFloat',[]),B),A),C,D,E).
  337.  
  338. :-block 'Prelude.prim_ltEqFloat'(?,?,?,-,?).
  339. 'Prelude.prim_ltEqFloat'(A,B,C,D,E):-derefRoot(A,F),derefRoot(B,G),prim_leqNumber(F,G,C),D=E.
  340.  
  341. :-block 'Prelude.fst'(?,?,-,?).
  342. 'Prelude.fst'(A,B,C,D):-hnf(A,E,C,F),'Prelude.fst_1'(E,B,F,D).
  343.  
  344. :-block 'Prelude.fst_1'(?,?,-,?).
  345. 'Prelude.fst_1'('Prelude.(,)'(A,B),C,D,E):-!,hnf(A,C,D,E).
  346. 'Prelude.fst_1'('FAIL'(A),'FAIL'(A),B,B):-nonvar(A).
  347.  
  348. :-block 'Prelude.snd'(?,?,-,?).
  349. 'Prelude.snd'(A,B,C,D):-hnf(A,E,C,F),'Prelude.snd_1'(E,B,F,D).
  350.  
  351. :-block 'Prelude.snd_1'(?,?,-,?).
  352. 'Prelude.snd_1'('Prelude.(,)'(A,B),C,D,E):-!,hnf(B,C,D,E).
  353. 'Prelude.snd_1'('FAIL'(A),'FAIL'(A),B,B):-nonvar(A).
  354.  
  355. :-block 'Prelude.head'(?,?,-,?).
  356. 'Prelude.head'(A,B,C,D):-hnf(A,E,C,F),'Prelude.head_1'(E,B,F,D).
  357.  
  358. :-block 'Prelude.head_1'(?,?,-,?).
  359. 'Prelude.head_1'([A|B],C,D,E):-!,hnf(A,C,D,E).
  360. 'Prelude.head_1'([],A,B,C):-!,hnf('Prelude.failure'('Prelude.head',[[]]),A,B,C).
  361. 'Prelude.head_1'('FAIL'(A),'FAIL'(A),B,B).
  362.  
  363. :-block 'Prelude.tail'(?,?,-,?).
  364. 'Prelude.tail'(A,B,C,D):-hnf(A,E,C,F),'Prelude.tail_1'(E,B,F,D).
  365.  
  366. :-block 'Prelude.tail_1'(?,?,-,?).
  367. 'Prelude.tail_1'([A|B],C,D,E):-!,hnf(B,C,D,E).
  368. 'Prelude.tail_1'([],A,B,C):-!,hnf('Prelude.failure'('Prelude.tail',[[]]),A,B,C).
  369. 'Prelude.tail_1'('FAIL'(A),'FAIL'(A),B,B).
  370.  
  371. :-block 'Prelude.null'(?,?,-,?).
  372. 'Prelude.null'(A,B,C,D):-hnf(A,E,C,F),'Prelude.null_1'(E,B,F,D).
  373.  
  374. :-block 'Prelude.null_1'(?,?,-,?).
  375. 'Prelude.null_1'([],'Prelude.True',A,A).
  376. 'Prelude.null_1'([A|B],'Prelude.False',C,C):-!.
  377. 'Prelude.null_1'('FAIL'(A),'FAIL'(A),B,B):-nonvar(A).
  378.  
  379. :-block 'Prelude.++'(?,?,?,-,?).
  380. 'Prelude.++'(A,B,C,D,E):-hnf(A,F,D,G),'Prelude.++_1'(F,B,C,G,E).
  381.  
  382. :-block 'Prelude.++_1'(?,?,?,-,?).
  383. 'Prelude.++_1'([],A,B,C,D):-hnf(A,B,C,D).
  384. 'Prelude.++_1'([A|B],C,[A|'Prelude.++'(B,C)],D,D):-!.
  385. 'Prelude.++_1'('FAIL'(A),B,'FAIL'(A),C,C):-nonvar(A).
  386.  
  387. :-block 'Prelude.length'(?,?,-,?).
  388. 'Prelude.length'(A,B,C,D):-hnf('Prelude.length.len.92'('Prelude._inst\'23Prelude.Num\'23Prelude.Int',A,0),B,C,D).
  389.  
  390. :-block 'Prelude.length.len.92'(?,?,?,?,-,?).
  391. 'Prelude.length.len.92'(A,B,C,D,E,F):-hnf(B,G,E,H),'Prelude.length.len.92_2'(G,A,C,D,H,F).
  392.  
  393. :-block 'Prelude.length.len.92_2'(?,?,?,?,-,?).
  394. 'Prelude.length.len.92_2'([],A,B,C,D,E):-hnf(B,C,D,E).
  395. 'Prelude.length.len.92_2'([A|B],C,D,E,F,G):-!,makeShare(H,I),makeShare(C,J),hnf('Prelude.cond'('Prelude.letrec'(I,'Prelude.apply'('Prelude.apply'('Prelude.+'(J),D),'Prelude.apply'('Prelude.fromInt'(J),1))),'Prelude.$!!'(partcall(1,'Prelude.length.len.92',[B,J]),I)),E,F,G).
  396. 'Prelude.length.len.92_2'('FAIL'(A),B,C,'FAIL'(A),D,D):-nonvar(A).
  397.  
  398. :-block 'Prelude.!!'(?,?,?,-,?).
  399. 'Prelude.!!'(A,B,C,D,E):-hnf(A,F,D,G),'Prelude.!!_1'(F,B,C,G,E).
  400.  
  401. :-block 'Prelude.!!_1'(?,?,?,-,?).
  402. 'Prelude.!!_1'([A|B],C,D,E,F):-!,makeShare(C,G),hnf('Prelude._impl\'23\'3D\'3D\'23Prelude.Eq\'23Prelude.Int'(G,0),H,E,I),'Prelude.!!_1_._ComplexCase'(H,A,B,G,D,I,F).
  403.  
  404. :-block 'Prelude.!!_1_._ComplexCase'(-,?,?,?,?,?,?),'Prelude.!!_1_._ComplexCase'(?,?,?,?,?,-,?).
  405. 'Prelude.!!_1_._ComplexCase'('Prelude.True',A,B,C,D,E,F):-hnf(A,D,E,F).
  406. 'Prelude.!!_1_._ComplexCase'('Prelude.False',A,B,C,D,E,F):-!,makeShare(C,G),hnf('Prelude.apply'('Prelude.apply'('Prelude._impl\'23\'3E\'23Prelude.Ord\'23Prelude.Int',G),0),H,E,I),'Prelude.!!_1_._ComplexCase_Prelude.False_ComplexCase'(H,A,B,G,D,I,F).
  407.  
  408. :-block 'Prelude.!!_1_._ComplexCase_Prelude.False_ComplexCase'(-,?,?,?,?,?,?),'Prelude.!!_1_._ComplexCase_Prelude.False_ComplexCase'(?,?,?,?,?,-,?).
  409. 'Prelude.!!_1_._ComplexCase_Prelude.False_ComplexCase'('Prelude.True',A,B,C,D,E,F):-hnf('Prelude.!!'(B,'Prelude._impl\'23\'2D\'23Prelude.Num\'23Prelude.Int'(C,1)),D,E,F).
  410. 'Prelude.!!_1_._ComplexCase_Prelude.False_ComplexCase'('Prelude.False',A,B,C,D,E,F):-!,hnf('Prelude.failure'('Prelude.!!',['Prelude.False']),D,E,F).
  411. 'Prelude.!!_1_._ComplexCase_Prelude.False_ComplexCase'('FAIL'(A),B,C,D,'FAIL'(A),E,E).
  412. 'Prelude.!!_1_._ComplexCase'('FAIL'(A),B,C,D,'FAIL'(A),E,E).
  413. 'Prelude.!!_1'([],A,B,C,D):-!,hnf('Prelude.failure'('Prelude.!!',[[]]),B,C,D).
  414. 'Prelude.!!_1'('FAIL'(A),B,'FAIL'(A),C,C).
  415.  
  416. :-block 'Prelude.map'(?,?,?,-,?).
  417. 'Prelude.map'(A,B,C,D,E):-hnf(B,F,D,G),'Prelude.map_2'(F,A,C,G,E).
  418.  
  419. :-block 'Prelude.map_2'(?,?,?,-,?).
  420. 'Prelude.map_2'([],A,[],B,B).
  421. 'Prelude.map_2'([A|B],C,['Prelude.apply'(D,A)|'Prelude.map'(D,B)],E,F):-!,makeShare(C,D),E=F.
  422. 'Prelude.map_2'('FAIL'(A),B,'FAIL'(A),C,C):-nonvar(A).
  423.  
  424. :-block 'Prelude.foldl'(?,?,?,?,-,?).
  425. 'Prelude.foldl'(A,B,C,D,E,F):-hnf(C,G,E,H),'Prelude.foldl_3'(G,A,B,D,H,F).
  426.  
  427. :-block 'Prelude.foldl_3'(?,?,?,?,-,?).
  428. 'Prelude.foldl_3'([],A,B,C,D,E):-hnf(B,C,D,E).
  429. 'Prelude.foldl_3'([A|B],C,D,E,F,G):-!,makeShare(C,H),hnf('Prelude.foldl'(H,'Prelude.apply'('Prelude.apply'(H,D),A),B),E,F,G).
  430. 'Prelude.foldl_3'('FAIL'(A),B,C,'FAIL'(A),D,D):-nonvar(A).
  431.  
  432. :-block 'Prelude.foldl1'(?,?,?,-,?).
  433. 'Prelude.foldl1'(A,B,C,D,E):-hnf(B,F,D,G),'Prelude.foldl1_2'(F,A,C,G,E).
  434.  
  435. :-block 'Prelude.foldl1_2'(?,?,?,-,?).
  436. 'Prelude.foldl1_2'([A|B],C,D,E,F):-!,hnf('Prelude.foldl'(C,A,B),D,E,F).
  437. 'Prelude.foldl1_2'([],A,B,C,D):-!,hnf('Prelude.failure'('Prelude.foldl1',[[]]),B,C,D).
  438. 'Prelude.foldl1_2'('FAIL'(A),B,'FAIL'(A),C,C).
  439.  
  440. :-block 'Prelude.foldr'(?,?,?,?,-,?).
  441. 'Prelude.foldr'(A,B,C,D,E,F):-hnf(C,G,E,H),'Prelude.foldr_3'(G,A,B,D,H,F).
  442.  
  443. :-block 'Prelude.foldr_3'(?,?,?,?,-,?).
  444. 'Prelude.foldr_3'([],A,B,C,D,E):-hnf(B,C,D,E).
  445. 'Prelude.foldr_3'([A|B],C,D,E,F,G):-!,makeShare(C,H),hnf('Prelude.apply'('Prelude.apply'(H,A),'Prelude.foldr'(H,D,B)),E,F,G).
  446. 'Prelude.foldr_3'('FAIL'(A),B,C,'FAIL'(A),D,D):-nonvar(A).
  447.  
  448. :-block 'Prelude.foldr1'(?,?,?,-,?).
  449. 'Prelude.foldr1'(A,B,C,D,E):-hnf(B,F,D,G),'Prelude.foldr1_2'(F,A,C,G,E).
  450.  
  451. :-block 'Prelude.foldr1_2'(?,?,?,-,?).
  452. 'Prelude.foldr1_2'([A|B],C,D,E,F):-!,makeShare(B,G),hnf(G,H,E,I),'Prelude.foldr1_2_._2'(H,A,H,C,D,I,F).
  453.  
  454. :-block 'Prelude.foldr1_2_._2'(?,?,?,?,?,-,?).
  455. 'Prelude.foldr1_2_._2'([],A,B,C,D,E,F):-hnf(A,D,E,F).
  456. 'Prelude.foldr1_2_._2'([A|B],C,D,E,F,G,H):-!,makeShare(E,I),hnf('Prelude.apply'('Prelude.apply'(I,C),'Prelude.foldr1'(I,D)),F,G,H).
  457. 'Prelude.foldr1_2_._2'('FAIL'(A),B,C,D,'FAIL'(A),E,E):-nonvar(A).
  458. 'Prelude.foldr1_2'([],A,B,C,D):-!,hnf('Prelude.failure'('Prelude.foldr1',[[]]),B,C,D).
  459. 'Prelude.foldr1_2'('FAIL'(A),B,'FAIL'(A),C,C).
  460.  
  461. :-block 'Prelude.filter'(?,?,?,-,?).
  462. 'Prelude.filter'(A,B,C,D,E):-hnf(B,F,D,G),'Prelude.filter_2'(F,A,C,G,E).
  463.  
  464. :-block 'Prelude.filter_2'(?,?,?,-,?).
  465. 'Prelude.filter_2'([],A,[],B,B).
  466. 'Prelude.filter_2'([A|B],C,D,E,F):-!,makeShare(C,G),makeShare(A,H),hnf('Prelude.apply'(G,H),I,E,J),'Prelude.filter_2_._ComplexCase'(I,H,B,G,D,J,F).
  467.  
  468. :-block 'Prelude.filter_2_._ComplexCase'(-,?,?,?,?,?,?),'Prelude.filter_2_._ComplexCase'(?,?,?,?,?,-,?).
  469. 'Prelude.filter_2_._ComplexCase'('Prelude.True',A,B,C,[A|'Prelude.filter'(C,B)],D,D).
  470. 'Prelude.filter_2_._ComplexCase'('Prelude.False',A,B,C,D,E,F):-!,hnf('Prelude.filter'(C,B),D,E,F).
  471. 'Prelude.filter_2_._ComplexCase'('FAIL'(A),B,C,D,'FAIL'(A),E,E).
  472. 'Prelude.filter_2'('FAIL'(A),B,'FAIL'(A),C,C):-nonvar(A).
  473.  
  474. :-block 'Prelude.zip'(?,?,?,-,?).
  475. 'Prelude.zip'(A,B,C,D,E):-hnf(A,F,D,G),'Prelude.zip_1'(F,B,C,G,E).
  476.  
  477. :-block 'Prelude.zip_1'(?,?,?,-,?).
  478. 'Prelude.zip_1'([],A,[],B,B).
  479. 'Prelude.zip_1'([A|B],C,D,E,F):-!,hnf(C,G,E,H),'Prelude.zip_1_._3'(G,A,B,D,H,F).
  480.  
  481. :-block 'Prelude.zip_1_._3'(?,?,?,?,-,?).
  482. 'Prelude.zip_1_._3'([],A,B,[],C,C).
  483. 'Prelude.zip_1_._3'([A|B],C,D,['Prelude.(,)'(C,A)|'Prelude.zip'(D,B)],E,E):-!.
  484. 'Prelude.zip_1_._3'('FAIL'(A),B,C,'FAIL'(A),D,D):-nonvar(A).
  485. 'Prelude.zip_1'('FAIL'(A),B,'FAIL'(A),C,C):-nonvar(A).
  486.  
  487. :-block 'Prelude.zip3'(?,?,?,?,-,?).
  488. 'Prelude.zip3'(A,B,C,D,E,F):-hnf(A,G,E,H),'Prelude.zip3_1'(G,B,C,D,H,F).
  489.  
  490. :-block 'Prelude.zip3_1'(?,?,?,?,-,?).
  491. 'Prelude.zip3_1'([],A,B,[],C,C).
  492. 'Prelude.zip3_1'([A|B],C,D,E,F,G):-!,hnf(C,H,F,I),'Prelude.zip3_1_._3'(H,A,B,D,E,I,G).
  493.  
  494. :-block 'Prelude.zip3_1_._3'(?,?,?,?,?,-,?).
  495. 'Prelude.zip3_1_._3'([],A,B,C,[],D,D).
  496. 'Prelude.zip3_1_._3'([A|B],C,D,E,F,G,H):-!,hnf(E,I,G,J),'Prelude.zip3_1_._3_._5'(I,A,B,C,D,F,J,H).
  497.  
  498. :-block 'Prelude.zip3_1_._3_._5'(?,?,?,?,?,?,-,?).
  499. 'Prelude.zip3_1_._3_._5'([],A,B,C,D,[],E,E).
  500. 'Prelude.zip3_1_._3_._5'([A|B],C,D,E,F,['Prelude.(,,)'(E,C,A)|'Prelude.zip3'(F,D,B)],G,G):-!.
  501. 'Prelude.zip3_1_._3_._5'('FAIL'(A),B,C,D,E,'FAIL'(A),F,F):-nonvar(A).
  502. 'Prelude.zip3_1_._3'('FAIL'(A),B,C,D,'FAIL'(A),E,E):-nonvar(A).
  503. 'Prelude.zip3_1'('FAIL'(A),B,C,'FAIL'(A),D,D):-nonvar(A).
  504.  
  505. :-block 'Prelude.zipWith'(?,?,?,?,-,?).
  506. 'Prelude.zipWith'(A,B,C,D,E,F):-hnf(B,G,E,H),'Prelude.zipWith_2'(G,A,C,D,H,F).
  507.  
  508. :-block 'Prelude.zipWith_2'(?,?,?,?,-,?).
  509. 'Prelude.zipWith_2'([],A,B,[],C,C).
  510. 'Prelude.zipWith_2'([A|B],C,D,E,F,G):-!,hnf(D,H,F,I),'Prelude.zipWith_2_._4'(H,A,B,C,E,I,G).
  511.  
  512. :-block 'Prelude.zipWith_2_._4'(?,?,?,?,?,-,?).
  513. 'Prelude.zipWith_2_._4'([],A,B,C,[],D,D).
  514. 'Prelude.zipWith_2_._4'([A|B],C,D,E,['Prelude.apply'('Prelude.apply'(F,C),A)|'Prelude.zipWith'(F,D,B)],G,H):-!,makeShare(E,F),G=H.
  515. 'Prelude.zipWith_2_._4'('FAIL'(A),B,C,D,'FAIL'(A),E,E):-nonvar(A).
  516. 'Prelude.zipWith_2'('FAIL'(A),B,C,'FAIL'(A),D,D):-nonvar(A).
  517.  
  518. :-block 'Prelude.zipWith3'(?,?,?,?,?,-,?).
  519. 'Prelude.zipWith3'(A,B,C,D,E,F,G):-hnf(B,H,F,I),'Prelude.zipWith3_2'(H,A,C,D,E,I,G).
  520.  
  521. :-block 'Prelude.zipWith3_2'(?,?,?,?,?,-,?).
  522. 'Prelude.zipWith3_2'([],A,B,C,[],D,D).
  523. 'Prelude.zipWith3_2'([A|B],C,D,E,F,G,H):-!,hnf(D,I,G,J),'Prelude.zipWith3_2_._4'(I,A,B,C,E,F,J,H).
  524.  
  525. :-block 'Prelude.zipWith3_2_._4'(?,?,?,?,?,?,-,?).
  526. 'Prelude.zipWith3_2_._4'([],A,B,C,D,[],E,E).
  527. 'Prelude.zipWith3_2_._4'([A|B],C,D,E,F,G,H,I):-!,hnf(F,J,H,K),'Prelude.zipWith3_2_._4_._6'(J,A,B,C,D,E,G,K,I).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement