Skip to content

Instantly share code, notes, and snippets.

@chrisdone
Created January 11, 2017 17:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisdone/7aea4748c6fd0f1854d341b5676a4a97 to your computer and use it in GitHub Desktop.
Save chrisdone/7aea4748c6fd0f1854d341b5676a4a97 to your computer and use it in GitHub Desktop.
Xeno examples
-- RHS size: {terms: 254, types: 135, coercions: 0}
Xeno.$wparse [InlPrag=[0]]
:: GHC.Prim.Addr#
-> GHC.ForeignPtr.ForeignPtrContents
-> GHC.Prim.Int#
-> GHC.Prim.Int#
-> ()
[GblId,
Arity=4,
Str=DmdType <L,U><L,U><L,U><S,U>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0 0 0] 722 0}]
Xeno.$wparse =
\ (ww_s3PP :: GHC.Prim.Addr#)
(ww1_s3PQ :: GHC.ForeignPtr.ForeignPtrContents)
(ww2_s3PR :: GHC.Prim.Int#)
(ww3_s3PS :: GHC.Prim.Int#) ->
let {
p'_s3RK :: GHC.Prim.Addr#
[LclId, Str=DmdType]
p'_s3RK = GHC.Prim.plusAddr# ww_s3PP ww2_s3PR } in
letrec {
$w$j_s3RI [InlPrag=[0]] :: GHC.Prim.Int# -> ()
[LclId, Arity=1, Str=DmdType <S,U>]
$w$j_s3RI =
\ (ww4_s3PD [OS=OneShot] :: GHC.Prim.Int#) ->
case GHC.Prim.tagToEnum# @ Bool (GHC.Prim.<=# ww4_s3PD 0#)
of _ [Occ=Dead] {
False ->
case GHC.Prim.tagToEnum# @ Bool (GHC.Prim.>=# ww4_s3PD ww3_s3PS)
of _ [Occ=Dead] {
False ->
let {
p'1_s3KV [Dmd=<S,U>] :: GHC.Prim.Addr#
[LclId, Str=DmdType]
p'1_s3KV =
GHC.Prim.plusAddr# ww_s3PP (GHC.Prim.+# ww2_s3PR ww4_s3PD) } in
case {__pkg_ccall bytestring-0.10.8.1 memchr Addr#
-> Int#
-> Word#
-> State# RealWorld
-> (# State# RealWorld, Addr# #)}_a3J5
p'1_s3KV
62#
(GHC.Prim.int2Word# (GHC.Prim.-# ww3_s3PS ww4_s3PD))
GHC.Prim.realWorld#
of _ [Occ=Dead] { (# ds4_a3Ja, ds5_a3Jb #) ->
case GHC.Prim.tagToEnum# @ Bool (GHC.Prim.eqAddr# ds5_a3Jb __NULL)
of _ [Occ=Dead] {
False ->
case GHC.Prim.touch#
@ 'GHC.Types.PtrRepLifted
@ GHC.ForeignPtr.ForeignPtrContents
ww1_s3PQ
ds4_a3Ja
of _ [Occ=Dead, OS=OneShot] { __DEFAULT ->
$wparseTags_s3PL
(GHC.Prim.+#
(GHC.Prim.+# (GHC.Prim.minusAddr# ds5_a3Jb p'1_s3KV) ww4_s3PD) 1#)
};
True ->
case GHC.Prim.touch#
@ 'GHC.Types.PtrRepLifted
@ GHC.ForeignPtr.ForeignPtrContents
ww1_s3PQ
ds4_a3Ja
of _ [Occ=Dead, OS=OneShot] { __DEFAULT ->
GHC.Tuple.()
}
}
};
True ->
case {__pkg_ccall bytestring-0.10.8.1 memchr Addr#
-> Int#
-> Word#
-> State# RealWorld
-> (# State# RealWorld, Addr# #)}_a3J5
__NULL 62# 0## GHC.Prim.realWorld#
of _ [Occ=Dead] { (# ds4_a3Ja, ds5_a3Jb #) ->
case GHC.Prim.tagToEnum# @ Bool (GHC.Prim.eqAddr# ds5_a3Jb __NULL)
of _ [Occ=Dead] {
False ->
case GHC.Prim.touch#
@ 'GHC.Types.PtrRepLifted
@ GHC.ForeignPtr.ForeignPtrContents
Data.ByteString.Internal.$fMonoidByteString3
ds4_a3Ja
of _ [Occ=Dead, OS=OneShot] { __DEFAULT ->
$wparseTags_s3PL
(GHC.Prim.+#
(GHC.Prim.+# (GHC.Prim.minusAddr# ds5_a3Jb __NULL) ww4_s3PD) 1#)
};
True ->
case GHC.Prim.touch#
@ 'GHC.Types.PtrRepLifted
@ GHC.ForeignPtr.ForeignPtrContents
Data.ByteString.Internal.$fMonoidByteString3
ds4_a3Ja
of _ [Occ=Dead, OS=OneShot] { __DEFAULT ->
GHC.Tuple.()
}
}
}
};
True ->
case {__pkg_ccall bytestring-0.10.8.1 memchr Addr#
-> Int#
-> Word#
-> State# RealWorld
-> (# State# RealWorld, Addr# #)}_a3J5
p'_s3RK 62# (GHC.Prim.int2Word# ww3_s3PS) GHC.Prim.realWorld#
of _ [Occ=Dead] { (# ds4_a3Ja, ds5_a3Jb #) ->
case GHC.Prim.tagToEnum# @ Bool (GHC.Prim.eqAddr# ds5_a3Jb __NULL)
of _ [Occ=Dead] {
False ->
case GHC.Prim.touch#
@ 'GHC.Types.PtrRepLifted
@ GHC.ForeignPtr.ForeignPtrContents
ww1_s3PQ
ds4_a3Ja
of _ [Occ=Dead, OS=OneShot] { __DEFAULT ->
$wparseTags_s3PL
(GHC.Prim.+#
(GHC.Prim.+# (GHC.Prim.minusAddr# ds5_a3Jb p'_s3RK) ww4_s3PD) 1#)
};
True ->
case GHC.Prim.touch#
@ 'GHC.Types.PtrRepLifted
@ GHC.ForeignPtr.ForeignPtrContents
ww1_s3PQ
ds4_a3Ja
of _ [Occ=Dead, OS=OneShot] { __DEFAULT ->
GHC.Tuple.()
}
}
}
};
$wparseTags_s3PL [InlPrag=[0], Occ=LoopBreaker]
:: GHC.Prim.Int# -> ()
[LclId, Arity=1, Str=DmdType <S,U>]
$wparseTags_s3PL =
\ (ww4_s3PJ :: GHC.Prim.Int#) ->
case GHC.Prim.tagToEnum# @ Bool (GHC.Prim.<=# ww4_s3PJ 0#)
of _ [Occ=Dead] {
False ->
case GHC.Prim.tagToEnum# @ Bool (GHC.Prim.>=# ww4_s3PJ ww3_s3PS)
of _ [Occ=Dead] {
False ->
let {
p'1_s3KA [Dmd=<S,U>] :: GHC.Prim.Addr#
[LclId, Str=DmdType]
p'1_s3KA =
GHC.Prim.plusAddr# ww_s3PP (GHC.Prim.+# ww2_s3PR ww4_s3PJ) } in
case {__pkg_ccall bytestring-0.10.8.1 memchr Addr#
-> Int#
-> Word#
-> State# RealWorld
-> (# State# RealWorld, Addr# #)}_a3J5
p'1_s3KA
60#
(GHC.Prim.int2Word# (GHC.Prim.-# ww3_s3PS ww4_s3PJ))
GHC.Prim.realWorld#
of _ [Occ=Dead] { (# ds4_a3Ja, ds5_a3Jb #) ->
case GHC.Prim.tagToEnum# @ Bool (GHC.Prim.eqAddr# ds5_a3Jb __NULL)
of _ [Occ=Dead] {
False ->
case GHC.Prim.touch#
@ 'GHC.Types.PtrRepLifted
@ GHC.ForeignPtr.ForeignPtrContents
ww1_s3PQ
ds4_a3Ja
of _ [Occ=Dead, OS=OneShot] { __DEFAULT ->
$w$j_s3RI
(GHC.Prim.+# (GHC.Prim.minusAddr# ds5_a3Jb p'1_s3KA) ww4_s3PJ)
};
True ->
case GHC.Prim.touch#
@ 'GHC.Types.PtrRepLifted
@ GHC.ForeignPtr.ForeignPtrContents
ww1_s3PQ
ds4_a3Ja
of _ [Occ=Dead, OS=OneShot] { __DEFAULT ->
GHC.Tuple.()
}
}
};
True ->
case {__pkg_ccall bytestring-0.10.8.1 memchr Addr#
-> Int#
-> Word#
-> State# RealWorld
-> (# State# RealWorld, Addr# #)}_a3J5
__NULL 60# 0## GHC.Prim.realWorld#
of _ [Occ=Dead] { (# ds4_a3Ja, ds5_a3Jb #) ->
case GHC.Prim.tagToEnum# @ Bool (GHC.Prim.eqAddr# ds5_a3Jb __NULL)
of _ [Occ=Dead] {
False ->
case GHC.Prim.touch#
@ 'GHC.Types.PtrRepLifted
@ GHC.ForeignPtr.ForeignPtrContents
Data.ByteString.Internal.$fMonoidByteString3
ds4_a3Ja
of _ [Occ=Dead, OS=OneShot] { __DEFAULT ->
$w$j_s3RI
(GHC.Prim.+# (GHC.Prim.minusAddr# ds5_a3Jb __NULL) ww4_s3PJ)
};
True ->
case GHC.Prim.touch#
@ 'GHC.Types.PtrRepLifted
@ GHC.ForeignPtr.ForeignPtrContents
Data.ByteString.Internal.$fMonoidByteString3
ds4_a3Ja
of _ [Occ=Dead, OS=OneShot] { __DEFAULT ->
GHC.Tuple.()
}
}
}
};
True ->
case {__pkg_ccall bytestring-0.10.8.1 memchr Addr#
-> Int#
-> Word#
-> State# RealWorld
-> (# State# RealWorld, Addr# #)}_a3J5
p'_s3RK 60# (GHC.Prim.int2Word# ww3_s3PS) GHC.Prim.realWorld#
of _ [Occ=Dead] { (# ds4_a3Ja, ds5_a3Jb #) ->
case GHC.Prim.tagToEnum# @ Bool (GHC.Prim.eqAddr# ds5_a3Jb __NULL)
of _ [Occ=Dead] {
False ->
case GHC.Prim.touch#
@ 'GHC.Types.PtrRepLifted
@ GHC.ForeignPtr.ForeignPtrContents
ww1_s3PQ
ds4_a3Ja
of _ [Occ=Dead, OS=OneShot] { __DEFAULT ->
$w$j_s3RI
(GHC.Prim.+# (GHC.Prim.minusAddr# ds5_a3Jb p'_s3RK) ww4_s3PJ)
};
True ->
case GHC.Prim.touch#
@ 'GHC.Types.PtrRepLifted
@ GHC.ForeignPtr.ForeignPtrContents
ww1_s3PQ
ds4_a3Ja
of _ [Occ=Dead, OS=OneShot] { __DEFAULT ->
GHC.Tuple.()
}
}
}
}; } in
$wparseTags_s3PL 0#
-- RHS size: {terms: 9, types: 6, coercions: 0}
parse [InlPrag=INLINE[0]] :: ByteString -> ()
[GblId,
Arity=1,
Str=DmdType <S(LLLS),U(U,U,U,U)>,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False)
Tmpl= \ (w_s3PM [Occ=Once!] :: ByteString) ->
case w_s3PM
of _ [Occ=Dead]
{ Data.ByteString.Internal.PS ww1_s3PP [Occ=Once]
ww2_s3PQ [Occ=Once] ww3_s3PR [Occ=Once]
ww4_s3PS [Occ=Once] ->
Xeno.$wparse ww1_s3PP ww2_s3PQ ww3_s3PR ww4_s3PS
}}]
parse =
\ (w_s3PM :: ByteString) ->
case w_s3PM
of _ [Occ=Dead]
{ Data.ByteString.Internal.PS ww1_s3PP ww2_s3PQ ww3_s3PR
ww4_s3PS ->
Xeno.$wparse ww1_s3PP ww2_s3PQ ww3_s3PR ww4_s3PS
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment