q@;      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * +, - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u vwxyz{|}~= BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0BDRSize in bytes type aliasEfor code documentation purpose only, just a simple type alias on Int#)Offset in a bytearray, string, type aliasEfor code documentation purpose only, just a simple type alias on Int#File size in bytes BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableSafe0DR BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone 0BDR:Flag record whether a specific byte array is pinned or notturn an Int# into a Bool<Since GHC 7.8, boolean primitive don't return Bool but Int#.A version friendly of andI#!A version friendly of quotRemInt#*A version friendly fo copyAddrToByteArray#only available from GHC 7.8*A mkWeak# version that keep working on 8.0,signature change in ghc-prim: * 0.4: mkWeakD :: o -> b -> c -> State RealWorld -> (State RealWorld, Weak b) * 0.5 :mkWeak :: o -> b -> (State RealWorld -> (State RealWorld, c )) -> State RealWorld -> (State RealWorld, Weak b) 6  BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableSafe0DR BSD-style FoundationstableportableSafe0DR BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableSafe0DR^`_ BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DRF BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DR/Only to use internally for internal error casesjFedfgih  ~ !lkj"#$'(<?),-./012=>3BCD56789:;@AMLOT]btz{| BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone06DR -Represent class of things that can be divided#(x div  y) * y + (x mod  y) == x1Represent class of things that can be subtracted.dNote that the result is not necessary of the same type as the operand depending on the actual type.For example: e.g. (-) :: Int -> Int -> Int (-) :: DateTime -> DateTime -> Seconds (-) :: Ptr a -> Ptr a -> PtrDiff9Represent class of things that can be multiplied togetherx * midentity = xmidentity * x = x$Identity element over multiplication;Multiplication of 2 elements that result in another element_Raise to power, repeated multiplication e.g. > a ^ 2 = a * a > a ^ 10 = (a ^ 5) * (a ^ 5) ..eRepresent class of things that can be added together, contains a neutral element and is commutative. x + azero = x azero + x = x x + y = y + x$Number literals that can be negative>Number literals, convertible through the generic Integer type.Fall number are Enum'erable, meaning that you can move to next elementSign of a signed number9convert an Integer to a type having the Number constraintZI6786 BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DIRBAn error related to the evaluation of a Partial value that failed.?it contains the name of the function and the reason for failurePartialiality wrapper."Throw an asynchronous PartialErrorCCreate a value that is partial. this can only be unwrap using the  functionDewrap a possible partial value*Partial function to get the head of a list1Partial function to grab the value inside a Maybe    BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DR?Exception during an operation accessing the vector out of boundXRepresent the type of operation, the index accessed, and the total length of the vector.<The type of operation that triggers an OutOfBound exception.&OOB_Index: reading an immutable vector"OOB_Read: reading a mutable vector!OOB_Write: write a mutable vector                 BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone 09;<=DR1Class of things that can be converted from a to b BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DRSize in element Size in bytes Same caveat as Offset apply here#Offset in element of a certain typeIOffset in bytes used for memory addressing (e.g. in a vector, string, ..)Int a terrible backing type which is hard to get away considering that GHC/haskell are mostly using this for offset. try to bring some sanity by a lightweight wrapping newtype Offset = Offset Int deriving (Show,Eq,Ord)File size in bytes !"#$  !"#$ BSD-style foundation experimentalportableNone0:DR Path type classddefines the Path associated types and basic functions to implement related to the path manipulation # TODO, add missing enhancement:``` splitExtension :: PathEnt path -> (PathEnt path, PathEnt path) addExtension :: PathEnt path -> PathEnt path -> PathEnt path ( .() :: path -> PathEnt path -> path (- .&) :: path -> PathEnt path -> path ```'the associated PathEntity of the given path this type is the minimal element contained in the Path a Path is not a collection but it is possible to see this associated type equivalent to the   type family#the associated prefix of the given pathin the case of a FilePath., it is a void (i.e. `()`) in the case of an URI!, it is the schema, host, port...'the associated suffix of the given pathin the case of the FilePath/, it is a void (i.e. `()`) in the case of the URI!, it is a the query, the fragment"join a path entity to a given path+split the path into the associated elements+build the path from the associated elements*parent is only going to drop the filename.Gif you actually want to reference to the parent directory, simply uses:``` parent "." = "." < > ".." ```"get the filename of the given pathCIf there is no filename, you will receive the mempty of the PathEntget the path prefix information ``` prefix "hometab" == () ```#or for URI (TODO, not yet accurate) ``` prefix " .http://github.com/vincenthz/hs-foundation?w=1"@ == URISchema http Nothing Nothing "github.com" Nothing ```get the path suffix information ``` suffix "hometab" == () ```#or for URI (TODO, not yet accurate) ``` suffix " .http://github.com/vincenthz/hs-foundation?w=1", == URISuffix (["w", "1"], Nothing) ``` %& %&  BSD-style foundation experimentalportableNone0DR  TODO this is not implemented yet            BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone 069;DR 1Collection of things that can be looked up by Key  '    ' BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone 0ABDRT)Primitive monad that can handle mutation.For example: IO and ST.3type of state token associated with the PrimMonad m0type of variable associated with the PrimMonad mmUnwrap the State# token to pass to a function a primitive function that returns an unboxed state and a value.&Throw Exception in the primitive monad(Run a Prim monad from a dedicated state#&Build a new variable in the Prim Monad#Read the variable in the Prim Monad$Write the variable in the Prim Monad( just like unwrapPrimMonad9 but throw away the result and return just the new State#)+Convert a prim monad to another prim monad.The net effect is that it coerce the state repr to another, so the runtime representation should be the same, otherwise hilary ensues.*%Convert any prim monad to an ST monad+%Convert any prim monad to an IO monad,$Convert any IO monad to a prim monad-(Touch primitive lifted to any prim monad()*+,-./()*+,- ()*+,-./ BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone 0BDR-Create a pointer with an associated finalizer3Check if 2 final ptr points on the same memory bitsit stand to reason that provided a final ptr that is still being referenced and thus have the memory still valid, if 2 final ptrs have the same address, they should be the same final ptr$create a new FinalPtr from a Pointer'Create a new FinalPtr from a ForeignPtr.Cast a finalized pointer from type a to type b!}Looks at the raw pointer inside a FinalPtr, making sure the data pointed by the pointer is not finalized during the call to f"Unsafe version of !  !"  !" !" BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0BDR #NRepresent the accessor for types that can be stored in the UArray and MUArray.=Types need to be a instance of storable and have fixed sized.$%get the size in bytes of a ty element%-return the element stored at a specific index&.Read an element at an index in a mutable array'7Write an element to a specific cell in a mutable array.(Read from Address, without a state. the value read should be considered a constant for all pratical purpose, otherwise bad thing will happens.)4Read a value from Addr in a specific primitive monad*3Write a value to Addr in a specific primitive monad0ICast a Size linked to type A (Size A) to a Size linked to type B (Size B)#$%&'()*0123456789:;<=>? #$%&'()*01234#$%&'()*0123456789:;<=>?  BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0BDR +7A Mutable array of types built on top of GHC primitive./Element in this array can be modified in place.@read a cell in a mutable array.2If the index is out of bounds, an error is raised.A<read from a cell in a mutable array without bounds checking.NReading from invalid memory can return unpredictable and invalid values. use @ if unsure.B#Write to a cell in a mutable array.2If the index is out of bounds, an error is raised.C;write to a cell in a mutable array without bounds checking.^Writing with invalid bounds will corrupt memory and your program will become unreliable. use B if unsure.D-Create a new pinned mutable array of size @n.Ball the cells are uninitialized and could contains invalid values.?All mutable arrays are allocated on a 64 bits aligned addressesE&Create a new mutable array of size @n.8TODO: heuristic to allocated unpinned (< 1K for example)FECopy a number of elements from an array to another array with offsetsG1return the numbers of elements in a mutable array+HIJK@ABCDLEMN,"the start pointer with a finalizer/the number of elements (in elements, not bytes)Fdestination arrayoffset at destination source arrayoffset at sourcenumber of elements to copyG+HIK@ABCDEMN,FG+HIJK@ABCDLEMN,FG  BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone 069;DR#$%&'()*#$%&'()*! BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0BDRO(Check if the byte is a continuation bytePJGet the number of following bytes given the first byte of a UTF8 sequence.Q(Check if the byte is a continuation byteRJGet the number of following bytes given the first byte of a UTF8 sequence. STUOPQRVWOPQRSTUOPQRVW" BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DRX?Simple helper to split a list repeatly when the predicate matchXYZ[\]XYZ[\]XYZ[\]# BSD-stylePsychohistorians experimentalportableNone0DR^Simple Reader monad_Simple State monad ^`a_bcdefghi^`a_bc^`a_bcdefghi$ BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0BDRjCopy all bytes from a byteArray to a mutableByteArrayk$Copy @nbBytes bytes from a byteArray to a mutableByteArray starting at an offsetlsame as j except copy using 32 bits wordmsame as j except copy using 64 bits wordjklmnojklmnojklmno% BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone $0BDR-/An array of type built on top of GHC primitive.The elements need to have fixed sized and the representation is a packed contiguous array in memory that can easily be passed to foreign interfacep4Copy every cells of an existing array to a new arrayq!Thaw an array to a mutable array.the array is not modified, instead a new mutable array is created and every values is copied, before returning the mutable array.r5Return the element at a specific index from an array.5If the index @n is out of bounds, an error is raised.sMReturn the element at a specific index from an array without bounds checking.NReading from invalid memory can return unpredictable and invalid values. use r if unsure.t+return the number of elements of the array.uCopy nu sequential elements from the specified offset in a source array to the specified position in a destination array.mThis function does not check bounds. Accessing invalid memory can return unpredictable and invalid values.vaAllocate a new array with a fill function that has access to the elements of the source array.w%Freeze a mutable array into an array./the MUArray must not be changed after freezing.xThaw an immutable array.*The UArray must not be used after thawing.yCreate a new array of size /n by settings each cells through the function f.z*Create a pinned array that is filled by a filler- function (typically an IO call like hGetBuf){&make an array from a list of elements.|transform an array to a list.}"Check if two vectors are identical~Compare 2 vectors7Append 2 arrays together by creating a new bigger array9update an array by creating a new array with the updates.Jthe operation copy the previous array, modify it in place, then freeze it.F-./pqrs0"the start pointer with a finalizer/the number of elements (in elements, not bytes)1tudestination arrayoffset at destination source arrayoffset at sourcenumber of elements to copyv Source arrayLength of the destination array4Function called for each element in the source arrayReturns the filled new arraywxythe size of the array,the function that set the value at the indexthe array createdzthe size of the arrayfilling function that{|}~2C#$%&'()*ACE-./pqrs01tuwxyz2D-./pqrs01tuvwxyz{|}~2  BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DR-./12-./12  BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DR  !",0 !" 0,& BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DR3Element type of a collection333' BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DR4/Give the ability to fold a collection on itself5%Left-associative fold of a structure.In the case of lists, foldl, when applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right: Efoldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xnNote that to produce the outermost application of the operator the entire input list must be traversed. This means that foldl' will diverge if given an infinite list.hAlso note that if you want an efficient left-fold, you probably want to use foldl' instead of foldl. The reason for this is that latter does not force the "inner" results (e.g. z f x1 in the above example) before applying them to the operator (e.g. to (f x2)). This results in a thunk chain O(n) elements long, which then must be evaluated from the outside-in.6QLeft-associative fold of a structure but with strict application of the operator.7&Right-associative fold of a structure. @foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)8SRight-associative fold of a structure, but with strict application of the operator.456784756845678( BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone 069;DR9.Collection of elements that can indexed by int9:;9;:9:;)None06DR<KA monomorphic functor that maps the inner values to values of the same type<=<=<==* BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DR>eCollection of things that can be made mutable, modified and then freezed into an immutable collection >?@ABCDEFGHI >?@AECDBGIFH> ?@ABCDEFGHI+ BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone 09:;<DRJ&A set of methods for ordered colectionKCheck if a collection is emptyL*Take the first @n elements of a collectionM)Take the last @n elements of a collectionN*Drop the first @n elements of a collectionO)Drop the last @n elements of a collectionP*Split the collection at the @n'th elementsQ7Split the collection at the @n'th elements from the endR:Split on a specific elements returning a list of colletionS1Split a collection when the predicate return trueT1Split a collection when the predicate return trueUThe Uv function takes an element and a list and `intersperses' that element between the elements of the list. For example, &intersperse ',' "abcde" == "a,b,c,d,e"VV xs xss is equivalent to ( (U xs xss)). It inserts the list xs in between the lists in xss and concatenates the result.W2Split a collection while the predicate return trueX2Filter all the elements that satisfy the predicateYReverse a collectionZyDecompose a collection into its first element and the remaining collection. If the collection is empty, returns Nothing.[Decompose a collection into a collection without its last element, and the last element If the collection is empty, returns Nothing.\+Prepend an element to an ordered collection]*Append an element to an ordered collection^(Find an element in an ordered collection_=Sort an ordered collection using the specified order function`,Length of a collection (number of Element c)a)Create a collection with a single elementJKLMNOPQRSTUVWXYZ[\]^_`aJ_XZK`LNPWSY^UV]a\MOQ[RTJKLMNOPQRSTUVWXYZ[\]^_`a,None0DIR$A Array being built chunks by chunks~The previous buffers are in reverse order, and this contains the current buffer and the state of progress packing ty inside. size of chunks (elements)..- BSD-style foundation experimentalportableNone 09;<=DRcc takes two collections and returns a collections of corresponding pairs. If one input collection is short, excess elements of the longer collection are discarded.dLike c, but works with 3 collections.eLike c, but works with 4 collections.fLike c, but works with 5 collections.gLike c, but works with 6 collections.hLike c, but works with 7 collections.iiq transforms a collection of pairs into a collection of first components and a collection of second components.jLike i0, but works on a collection of 3-element tuples.kLike i0, but works on a collection of 4-element tuples.lLike i0, but works on a collection of 5-element tuples.mLike i0, but works on a collection of 6-element tuples.nLike i0, but works on a collection of 7-element tuples.pp generalises cj by zipping with the function given as the first argument, instead of a tupling function. For example, p (+)U is applied to two collections to produce the collection of corresponding sums.qLike p, but works with 3 collections.rLike p, but works with 4 collections.sLike p, but works with 5 collections.tLike p, but works with 6 collections.uLike p, but works with 7 collections.#bcdefghijklmnopqrstubcdijefghklmnopqrstub cdefghijklmnopqrstu  BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone 069;DRG  3475689;:<=>?@AECDBGIFHJ_XZK`LNPWSY^UV]a\MOQ[RTbcdijefghklmnopqrstuHbcdefghijklmn3<==45678JKLMNOPQRSTUVWXYZ[\]^_`a>?@ABCDEFGHI9:;  opqrstu. BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0BDRvMutable Array of aw Array of a1return the numbers of elements in a mutable array5Return the element at a specific index from an array.5If the index @n is out of bounds, an error is raised.MReturn the element at a specific index from an array without bounds checking.NReading from invalid memory can return unpredictable and invalid values. use  if unsure.read a cell in a mutable array.2If the index is out of bounds, an error is raised.<read from a cell in a mutable array without bounds checking.NReading from invalid memory can return unpredictable and invalid values. use  if unsure.#Write to a cell in a mutable array.2If the index is out of bounds, an error is raised.;write to a cell in a mutable array without bounds checking.^Writing with invalid bounds will corrupt memory and your program will become unreliable. use  if unsure.%Freeze a mutable array into an array..the MArray must not be changed after freezing.Thaw an immutable array.)The Array must not be used after thawing.!Thaw an array to a mutable array.the array is not modified, instead a new mutable array is created and every values is copied, before returning the mutable array.ECopy a number of elements from an array to another array with offsetsCopy nu sequential elements from the specified offset in a source array to the specified position in a destination array.mThis function does not check bounds. Accessing invalid memory can return unpredictable and invalid values.aAllocate a new array with a fill function that has access to the elements of the source array.&Create a new mutable array of size @n.Ball the cells are uninitialized and could contains invalid values.|All mutable arrays are allocated on a 64 bits aligned addresses and always contains a number of bytes multiples of 64 bits.Create a new array of size /n by settings each cells through the function f.7Append 2 arrays together by creating a new bigger array@vwdestination arrayoffset at destination source arrayoffset at sourcenumber of elements to copydestination arrayoffset at destination source arrayoffset at sourcenumber of elements to copy Source arrayLength of the destination array4Function called for each element in the source arrayReturns the filled new arraythe size of the array,the function that set the value at the indexthe array created     vw>vw     / BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DR5Return the element at a specific index from a Bitmap.5If the index @n is out of bounds, an error is raised.MReturn the element at a specific index from an array without bounds checking.NReading from invalid memory can return unpredictable and invalid values. use  if unsure.&make an array from a list of elements.transform an array to a list."Check if two vectors are identicalCompare 2 vectors7Append 2 arrays together by creating a new bigger arrayTODO completely non optimized9xy !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH xy!"#$'(127xy !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH0None0DRIMutable Byte Array aliasIJKLIJKLIJKL1 BSD-style foundation experimentalportableNone0BDRMHassuming the given ByteArray is a valid modified UTF-8 sequence of bytesJWe only modify the given Unicode Null-character (0xC080) into a null bytesFIXME: need to evaluate the kind of modified UTF8 GHC is actually expecting it is plausible they only handle the Null Bytes, which this function actually does.NOPMMNOPM2 BSD-style Foundation experimentalportableNone0:DRQZthe unit element use for the encoding. i.e. Word8 for ASCII7 or UTF8, Word16 for UTF16...RIdefine the type of error handling you want to use for the next function. %type Error UTF8 = Either UTF8_InvalidSnconsume an `Unit encoding` and return the Unicode point and the position of the next possible `Unit encoding`TYhelper to convert a given Array in a given encoding into an array with another encoding.tThis is a helper to convert from one String encoding to another. This function is (quite) slow and needs some work.z``` let s16 = ... -- string in UTF16 -- create s8, a UTF8 String let s8 = runST $ convertWith UTF16 UTF8 (toBytes s16) print s8 ```UQRSVTInput's encoding typeOutput's encoding typethe input raw arrayUQRSVTUQRSVT3 BSD-style Foundation experimentalportableNone0BDRW>validate a given byte is within ASCII characters encoring size+This function check the 8th bit is set to 0Xfconsume an Ascii7 char and return the Unicode point and the position of the next possible Ascii7 char YZ[\]W^Xmethod to access a given byteindex of the byte_either successfully validated the ASCII char and returned the next index or fail with an error_\expecting it to be a valid Ascii character. otherwise this function will throw an exception`aYZ[\]YZ[\]W^X_`a4 BSD-style Foundation experimentalportableNone0BDR bcdefghijbcdefbcdefghij5 BSD-style Foundation experimentalportableNone0BDRklmnopqrkmnklmnopqr6 BSD-style Foundation experimentalportableNone0BDR stuvwxyz{stuvstuvwxyz{7 BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone 0:BDIR |ADifferent way to encode a Character in UTF8 represented as an ADT6Opaque packed array of characters in the UTF8 encoding}"Validate a bytearray for UTF8'nessUOn success Nothing is returned On Failure the position along with the failure reason~GCreate a string composed of a number @n of Chars (Unicode code points).<if the input @s contains less characters than required, thenSCreate a string with the remaining Chars after dropping @n Chars from the beginning:Split on the input string using the predicate as separatore.g. splitOn (== ',') "," == ["",""] splitOn (== ',') ",abc," == ["","abc",""] splitOn (== ':') "abc" == ["abc"] splitOn (== ':') "abc::def" == ["abc","","def"] splitOn (== ':') "::abc::def" == ["","","abc","","def"]Split at a given index.Allocate a new StringI with a fill function that has access to the characters of the source String. size in bytes5Allocate a MutableString of a specific size in bytes.LConvert a Byte Array directly to a string without checking for UTF8 validityConvert a String to a bytearrayOz{|}~|}~ Source string)Length of the destination string in bytes7Function called for each character in the source StringReturns the filled new string$in number of bytes, not of elements.z|{}~@z{|}~|}~ BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0BDR#+-vwxywv-+yx# BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DRz|{}~z{|}~8 BSD-style Foundation experimentalportableNone0DR!Print a string to standard output0Print a string with a newline to standard output BSD-style foundation experimentalportableNone0DR'errors related to FileName manipulation0this means a null byte was found in the FileName5this means a path separator was found in the FileNameencoding error"some unknown trainling bytes found+A filename (or path entity) in the FilePath  Authorised"""."".." "foundation" Unauthorised"/""file/""/file" "file/path")error associated to filepath manipulation2this mean there were 2 contiguous path separators.9This is not valid in Foundation's FilePath specifications$FilePath is a collection of FileNameTODO: Eq and Ord are implemented using Show This is not very efficient and would need to be improved Also, it is possible the ordering is not necessary what we want in this case.#A FilePath is one of the following:  An Absolute:#starts with one of the follwing "/" A relative:don't start with a "/" authorised:"/""filepath"".""..""workhaskellhs-foundation" unauthorised"path//""information about type of FilePathA file path being only  or ..define the Path separator for POSIX systems : / convert a FileName into a String?This function may throw an exception associated to the encoding*conversion of FileName into a list of Char"this function may throw exceptions,conversion of a FilePath into a list of Char"this function may throw exceptions/build a file path from a given list of filename7this is unsafe and is mainly needed for testing purpose(build a file name from a given ByteArray7this is unsafe and is mainly needed for testing purpose)   9 BSD-style foundation experimentalportableNone0DR: BSD-style Foundation experimentalportableNone0DR2list the file name in the given FilePath directoryqTODO: error management and not implemented yet getDirectory :: FilePath -> IO [FileName] getDirectory = undefinedOpen a new handle on the fileClose a handle-Read binary data directly from the specified .First argument is the Handle to read from, and the second is the number of bytes to read. It returns the bytes read, up to the specified size, or an empty array if EOF has been reached. is implemented in terms of hGetBuf.hGetNonBlocking is similar to , except that it will never block waiting for data to become available, instead it returns only whatever data is available. If there is no data available to be read,  returns an empty array.7Note: on Windows, this function behaves identically to .Like , except that a shorter array may be returned if there are not enough bytes immediately available to satisfy the whole request. N only blocks if there is no data available, and EOF has not yet been reached. filepath mode act opens a file using the mode and run acta. the by-product handle will be closed when act finish, either normally or through an exception.(The value returned is the result of act@IRead a binary file and return the whole content in one contiguous buffer.oFold over chunks file calling the callback function for each chunks read from the file, until the end of file. Fold callback functioninitial accumulator File to read YXWVU  BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DR YXWVU YXWVU; BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DRgContains all the information related to a file mapping, including the size and the finalizer function.kFrom a file mapping, create a final ptr which will automatically unmap memory when the pointer is garbage.<(c) Vincent Hanquez 2014 BSD-styleVincent Hanquez provisionalnon-portable (requires POSIX)None0DRMemory synchronization flagsperform asynchronous write.perform synchronous write.invalidate cache data.Advice to put on memory.only define the posix one. no specific advice, the default.BExpect page references in random order. No readahead should occur.RExpect page references in sequential order. Page should be readahead aggressively.IExpect access in the near future. Probably a good idea to readahead early(Do not expect access in the near future.Memory protection Mapping flag)memory changes are shared between process%memory changes are private to processMap pages of memory.vIf fd is present, this memory will represent the file associated. Otherwise, the memory will be an anonymous mapping.use mmapUnmap pages of memoryuse munmap7give advice to the operating system about use of memorycall madvise%lock a range of process address spacecall mlock'unlock a range of process address spacecall munlock set protection of memory mappingcall mprotect4memorySync synchronize memory with physical storage.FOn an anonymous mapping this function does not have any effect. call msync&Return the operating system page size.call sysconf'*The address to map to if MapFixed is used.The length of the mapping1the memory protection associated with the mapping=None0DR BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DR*Map in memory the whole content of a file.COnce the array goes out of scope, the memory get (eventually) unmap*Map in memory the whole content of a file, BSD-style foundation experimentalportableNone0DR4Enumeration of the known GHC supported architecture.9get the operating system on which the program is running.Either return the known  or a strict  of the OS name.This function uses the base's  function.<get the machine architecture on which the program is running1Either return the known architecture or a Strict  of the architecture name.This function uses the base's  function.get the compiler nameKget the compilerName from base package but convert it into a strict String*returns the number of CPUs the machine has&endianness of the current architecture     EJIHGEJIHG     > BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone05DR0Class of product types that have a third element1Class of product types that have a second element0Class of product types that have a first elementStrict tuple (a,b,c,d)Strict tuple (a,b,c)Strict tuple (a,b) BSD-style#Vincent Hanquez <vincent@snarc.org> experimentalportableNone0DR:Alias to Prelude String ([Char]) for compatibility purposeXReturns a list of the program's command line arguments (not including the program name).Fedfgih  ~ !lkj"#$%&'(<?)*+,-./012=>3BCD456789:;@AKMLNOPTSRQZ[\]^`_abcmnopqrstuvwxyz{|}#-wڰzLMt]{|vwuyx!lkj edihgf ~$ }#F2=>3BCD(<?)5;@A-./0789:6,14+*-#wc'O%N&mnqsropZ\[abKTSRQ"P`_^?@ABCDBCEBFGBFHBFIBFJ?KL?KMBCNBCOBCPBCQBCRBSTBUVBUWBXYBXZBX[BX\BC]BC^BC_BC`BCaBCbBFcBFd?KeBCfBCg?KhBijBklBSmBCnBopBqrBCs?tu?tv?tw?tx?tyBz{Bz|Bz}Bz~BC?tBU?t?tBBBBB?tBCBC?tBB?t?t?tBBXBBBBBBBBoBBBBBBBBBBBBBBBBBBBBBUBFBFBFBFBFBFBiBiBiBBBBBBBBBBBBCBCBCBCBCBCBCBCBCBBB?K?K?K?K?K?K?K?K?K?K      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\ ] ] ^ ^ _ _ ` ` a a b b cdefghijklmnopqqrstuvwxyz{|}~  %%%%%%&'p''''((())************++++++++++++++++++++++++--------------------..//7777777777777777788::::::     >> >!>">#>$>%>&>'>(>(>)>)>*>*+,-./B01B01B0234567839:;<=>?t?@B'B$BABBACBADBAEBoFBGHBIJKLMNOPIJQRSTUUVVWWMXYZ[\]^_`ab^`bcdefghijklmnopqrstuvwxyz{|}~               !!!!!!!!!""""""############$$$$$$%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%''(())*+++,,,,,,,,,,,---------------..............................................................////////////////////////////////////////////////// / / / / /000011112222223333333 333!3"444#44$444%4&5'5'55555(5)666*6+6666,6-7.7/7777077177273747576767777778797:7;77<777=7>777777777777?77@7A777777777B7C7D7E7F7G7H7I7J7K7LMNOPQRSTUVWXYZ[\]^_B`a:b:c:d:e;f;g;h;f;i;j;k<l<m<n<o<p<q<r<s<t<u<v<w<x<y<z<{<|<}<~<<<<<<<<<<<<<<<<<<<<B B >>>>>>>>>>>>>>>>'foundation-0.0.1-1SKsdw4nnd0LbEikizgDeb FoundationFoundation.System.Info Foundation.IOFoundation.StrictFoundation.NumberFoundation.ArrayFoundation.ConvertibleFoundation.VFS.PathFoundation.VFS.URIFoundation.CollectionFoundation.PrimitiveFoundation.ForeignFoundation.Array.InternalFoundation.StringFoundation.VFS.FilePathFoundation.IO.FileMapFoundation.Internal.PrimTypesFoundation.Internal.IdentityFoundation.Internal.PrimitiveFoundation.String.InternalFoundation.Internal.ProxyFoundation.Internal.IsListFoundation.Internal.BaseFoundation.PartialFoundation.Array.CommonFoundation.Internal.TypesElementFoundation.Collection.KeyedFoundation.Primitive.MonadFoundation.Primitive.FinalPtrFoundation.Primitive.Types Foundation.Array.Unboxed.MutableFoundation.String.UTF8TableFoundation.Collection.ListFoundation.Internal.MonadTransFoundation.Primitive.UtilsFoundation.Array.UnboxedFoundation.Collection.ElementFoundation.Collection.FoldableFoundation.Collection.Indexed"Foundation.Collection.InnerFunctorFoundation.Collection.Mutable Foundation.Collection.Sequential Foundation.Array.Unboxed.BuilderFoundation.Collection.ZippableFoundation.Array.BoxedFoundation.Array.Bitmap"Foundation.Array.Unboxed.ByteArrayFoundation.String.ModifiedUTF8#Foundation.String.Encoding.Encoding!Foundation.String.Encoding.ASCII7 Foundation.String.Encoding.UTF16 Foundation.String.Encoding.UTF32%Foundation.String.Encoding.ISO_8859_1Foundation.String.UTF8Foundation.IO.TerminalFoundation.VFSFoundation.IO.File"Foundation.Foreign.MemoryMap.Types"Foundation.Foreign.MemoryMap.PosixFoundation.Foreign.MemoryMapFoundation.Tupleghc-primGHC.PrimseqbaseGHC.Base otherwise$GHC.EnumenumFrom enumFromThen enumFromToenumFromThenTo GHC.Classes==>=fail>>=>>fmapreturn Data.String fromStringGHC.Real fromIntegral realToFracGHC.ExtsIsListfromList fromListNtoListmemptymappendmconcat<*>pure*>BoundedEnumEqMonadFunctorOrdGHC.ShowShowData.Typeable.InternalTypeableIsString Applicative Data.FoldableFoldableData.Traversable TraversableMonoid GHC.TypesBoolCharDoubleFloatIntGHC.IntInt8Int16Int32Int64 integer-gmpGHC.Integer.TypeIntegerMaybeOrderingRationalIOWordGHC.WordWord8Word16Word32Word64 Data.EitherEitherFalseNothingJustTrueLeftRightLTEQGT System.InfocompilerVersionItem Data.Version versionTags versionBranchVersion Control.Monad>=>Control.Category.idasum Data.Monoid<>GHC.IO.Exception IOException GHC.ExceptiondisplayException fromException toException Exception GHC.IO.IOMode ReadWriteMode AppendMode WriteModeReadModeIOModepartitionEithersrightsleftseither Data.Proxy asProxyTypeOfProxy Data.Functionon Data.Functor<$>^^maxBoundminBoundfromEnumtoEnumpredsuccshowListshow showsPrec Data.MaybemapMaybe catMaybes listToMaybe maybeToList fromMaybe isNothingisJustmaybe Data.TupleswapuncurrycurryasTypeOfuntil$!flipconst=<<<$<*<|>GHC.Err undefinederror SomeException/=compare<=&&||not<>maxminstrict1strict2strict3strict4strict5strict6 DivisibledivmoddivMod Subtractive Difference-Multiplicative midentity*^Additiveazero+scaleSignedabssignumNumber toIntegerSignNegativeZeroPositive fromInteger$fDivisibleWord64$fDivisibleWord32$fDivisibleWord16$fDivisibleWord8$fDivisibleWord$fDivisibleInt64$fDivisibleInt32$fDivisibleInt16$fDivisibleInt8$fDivisibleInt$fDivisibleInteger$fMultiplicativeWord64$fMultiplicativeWord32$fMultiplicativeWord16$fMultiplicativeWord8$fMultiplicativeWord$fMultiplicativeInt64$fMultiplicativeInt32$fMultiplicativeInt16$fMultiplicativeInt8$fMultiplicativeInt$fMultiplicativeInteger$fSubtractiveWord64$fSubtractiveWord32$fSubtractiveWord16$fSubtractiveWord8$fSubtractiveWord$fSubtractiveInt64$fSubtractiveInt32$fSubtractiveInt16$fSubtractiveInt8$fSubtractiveInt$fSubtractiveInteger$fAdditiveWord64$fAdditiveWord32$fAdditiveWord16$fAdditiveWord8$fAdditiveWord$fAdditiveInt64$fAdditiveInt32$fAdditiveInt16$fAdditiveInt8 $fAdditiveInt$fAdditiveInteger$fNumberWord64$fNumberWord32$fNumberWord16 $fNumberWord8 $fNumberWord $fSignedInt64 $fSignedInt32 $fSignedInt16 $fSignedInt8 $fSignedInt$fSignedInteger $fNumberInt64 $fNumberInt32 $fNumberInt16 $fNumberInt8 $fNumberInt$fNumberInteger$fEqSign PartialErrorPartialpartial fromPartial OutOfBound ConvertibleConvertconvert$fConvertibleaaPathPathEnt PathPrefix PathSuffix splitPath buildPathparentfilenameprefixsuffixURIPath URIFragmentURIQuery URIAuthority URISchemaURI $fPathURIKeyedCollectionKeyValuelookup PrimMonad PrimStatePrimVar primitive primThrow unPrimMonad primVarNew primVarRead primVarWriteFinalPtr FinalForeignfinalPtrSameMemory toFinalPtrtoFinalPtrForeign castFinalPtrwithFinalPtrNoTouch withFinalPtrwithUnsafeFinalPtrPrimTypeprimSizeInBytes primBaIndex primMbaRead primMbaWrite primAddrIndex primAddrRead primAddrWriteMUArraymutableForeignMemUArrayUVecBAUVecAddr foreignMemfromForeignPtrrecastfoldlfoldl'foldrfoldr'IndexedCollection! findIndex InnerFunctorimapMutableCollection Collection MutableKey MutableValue unsafeThaw unsafeFreezethawfreezemutUnsafeWritemutWrite mutUnsafeReadmutRead SequentialnulltakerevTakedroprevDropsplitAt revSplitAtsplitOnbreak breakElem intersperse intercalatespanfilterreverseunconsunsnocsnocconsfindsortBylength singleton BoxedZippablezipzip3zip4zip5zip6zip7unzipunzip3unzip4unzip5unzip6unzip7ZippablezipWithzipWith3zipWith4zipWith5zipWith6zipWith7MArrayArray MutableBitmapBitmapEncodingASCII7UTF8UTF16UTF32 ISO_8859_1ValidationFailure InvalidHeaderInvalidContinuation MissingByteString fromBytesfromBytesLenientfromBytesUnsafetoByteslineswordsputStrputStrLnFileNameFilePath RelativityAbsoluteRelativefilePathToStringfilePathToLStringunsafeFilePathunsafeFileName extension$fPathFilePath$fMonoidFileName$fIsStringFileName$fShowFileName$fExceptionFileName_Invalid$fIsStringFilePath$fExceptionFilePath_Invalid $fOrdFilePath $fEqFilePath$fShowFilePath$fEqRelativity$fShowRelativity$fShowFilePath_Invalid $fEqFileName$fShowFileName_InvalidopenFile closeFilehGetwithFilereadFile foldTextFile fileMapReadfileMapReadWith Endianness LittleEndian BigEndianOSWindowsOSXLinuxAndroidBSDosarch compilerNamecpus endianness$fShowOS$fEqOS$fOrdOS$fEnumOS $fBoundedOS$fDataOS $fShowArch$fEqArch $fOrdArch $fEnumArch $fBoundedArch $fDataArch$fEqEndianness$fShowEndiannessThdableThdTythdSndableSndTysndFstableFstTyfstTuple4Tuple3Tuple2LStringgetArgsSize#Offset# FileSize#Data.Functor.IdentityIdentity runIdentity PinnedStatusbool# compatAndI#compatQuotRemInt#compatCopyAddrToByteArray# compatMkWeak#isPinnedpinnedunpinned compatGetSizeofMutableByteArray#compatShrinkMutableByteArray#compatResizeMutableByteArray#W# internalError GHC.GenericsGenericRepfromtoandGHC.IOthrowIOthroworderingToSignscaleNumpowereven partialErrorheadfromJust fromRightfromLeft$fExceptionPartialErrorOutOfBoundOperation InvalidRecastRecastDestinationSizeRecastSourceSizeOOB_Read OOB_Write OOB_MemSet OOB_Index$fExceptionInvalidRecast$fExceptionOutOfBoundSizeSize8OffsetOffset8FileSize+. offsetOfE offsetPlusE offsetMinusE offsetRecastsizeOfE$fSubtractiveSize$fAdditiveSize$fSubtractiveOffset$fAdditiveOffsetinitlast$fKeyedCollection[] unPrimMonad_unsafePrimCastunsafePrimToSTunsafePrimToIOunsafePrimFromIO primTouch $fPrimMonadST $fPrimMonadIO sizeRecastprimOffsetRecast primOffsetOfE sizeAsOffset offsetAsSize$fPrimTypeChar$fPrimTypeDouble$fPrimTypeFloat$fPrimTypeInt64$fPrimTypeInt32$fPrimTypeInt16$fPrimTypeInt8$fPrimTypeWord64$fPrimTypeWord32$fPrimTypeWord16$fPrimTypeWord8read unsafeReadwrite unsafeWrite newPinnednewcopyAt mutableLengthMUVecMA MUVecAddrmutableArrayProxyTysizeInMutableBytesOfContent newUnpinned mutableSame newNativeisContinuation getNbBytesisContinuation# getNbBytes#TableunTable contTable headTable wordsWhenReaderState runReaderrunState $fMonadReader$fApplicativeReader$fFunctorReader $fMonadState$fApplicativeState$fFunctorStateprimCopyFreezedBytesprimCopyFreezedBytesOffsetprimCopyFreezedW32primCopyFreezedW64 primMutableByteArraySlideToStartprimMutableAddrSlideToStartcopyindex unsafeIndexunsafeCopyAtROunsafeCopyFromcreate createFromIO vFromListvToListequalvCompareappendupdate vectorProxyTy unsafeIndexer lengthSizeunsafeFreezeShrink freezeShrink unsafeSlideemptyconcat unsafeUpdatewithPtrwithMutablePtr unsafeRecast splitElemsubmapmapIndex$fIsListUArray$fMonoidUArray $fOrdUArray $fEqUArray $fShowUArray$fFoldableUArray $fFoldable[]$fIndexedCollectionUArray$fIndexedCollection[]$fInnerFunctorUArray$fInnerFunctor[]$fMutableCollectionMUArraymconcatCollection$fSequentialUArray$fSequential[]ArrayBuildingState ArrayBuilderrunArrayBuilder prevBuffers currentBuffer currentOffset chunkSizeappendTybuilduncons2uncons3uncons4uncons5uncons6uncons7uncurry2uncurry3uncurry4uncurry5uncurry6uncurry7$fBoxedZippable[]$fZippableUArray $fZippable[] onNewArrayfreezeUntilIndex$fBoxedZippableArray$fZippableArray$fIndexedCollectionArray$fMutableCollectionMArray$fSequentialArray$fInnerFunctorArray $fIsListArray $fOrdArray $fEqArray $fShowArray $fMonoidArray$fFunctorArray bitsPerTy bitmapIndex unoptimised $fMutableCollectionMutableBitmap$fIndexedCollectionBitmap$fSequentialBitmap$fFoldableBitmap$fInnerFunctorBitmap$fIsListBitmap$fMonoidBitmap $fOrdBitmap $fEqBitmap $fShowBitmapMutableByteArraymutableByteArraySetmutableByteArraySetBetweenmutableByteArrayMove fromModifiedaone accessBytesbuildByteArrayUnitError encodingNext convertFromTo encodingWriteisAsciinextASCII7_InvalidByteOutOfBound CharNotAscii$fEncodingASCII7$fExceptionASCII7_Invalid UTF16_InvalidInvalidUnicode$fEncodingUTF16$fExceptionUTF16_Invalid UTF32_Invalid$fEncodingUTF32$fExceptionUTF32_InvalidISO_8859_1_Invalid NotISO_8859_1$fEncodingISO_8859_1$fExceptionISO_8859_1_InvalidUTF8Charvalidate splitIndexsizeUTF8_1UTF8_2UTF8_3UTF8_4 EncoderUTF8 MutableStringmutableValidateskipNextnextWithIndexerwriteWithBuilder writeBytessToList sFromList replicate charToBytescharMapfromEncoderBytesfromChunkBytestoEncoderBytes$fEncodingEncoderUTF8$fExceptionValidationFailure$fZippableString$fSequentialString$fInnerFunctorString$fIsListString$fIsStringString $fShowStringFileName_InvalidContainsNullByteContainsSeparator EncodingErrorUnknownTrailingBytesFilePath_InvalidContiguousPathSeparatorpathSeparatorPOSIXfileNameToStringfileNameToLStringpathSeparatorPOSIXCpathSeparatorC pathSeparator hasNullByte hasSeparator isSeparatorhasContigueSeparatorsjoinfilenameIntercalateGHC.IO.Handle.TypesHandlehGetNonBlockinghGetSomeinvalidBufferSize blockSize FileMappingfileMappingToFinalPtr FileMapReadFfileMappingPtrfileMappingSizefileMappingUnmapMemorySyncFlagMemorySyncAsyncMemorySyncSyncMemorySyncInvalidate MemoryAdviceMemoryAdviceNormalMemoryAdviceRandomMemoryAdviceSequentialMemoryAdviceWillNeedMemoryAdviceDontNeedMemoryProtection MemoryMapFlagMemoryMapSharedMemoryMapPrivate memoryMap memoryUnmap memoryAdvise memoryLock memoryUnlock memoryProtect memorySyncsysconfPageSizeMemoryProtectionNoneMemoryProtectionReadMemoryProtectionWriteMemoryProtectionExecute c_sysconf c_munlockc_mlock c_mprotectc_msync c_madvisec_munmapc_mmapcvalueOfMemoryProtscvalueOfMemorySyncfileSizeToCSizefileSizeFromIntegergetSizeArchI386X86_64PowerPC PowerPC64SparcSparc64ARMARM64$fThdableTuple4$fThdableTuple3$fThdable(,,,) $fThdable(,,)$fSndableTuple4$fSndableTuple3$fSndableTuple2$fSndable(,,,) $fSndable(,,) $fSndable(,)$fFstableTuple4$fFstableTuple3$fFstableTuple2$fFstable(,,,) $fFstable(,,) $fFstable(,)