jqh      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ,non-portable (FD and MPTC. empty data decls) experimentalEdward Kmett <ekmett@gmail.com> Safe-Infered Type-Level: if t then x else y Type-Level: not a Type-Level: a implies b = c Qimplemented this way rather than directly so that Binary can extend it properly. C otherwise the normal form restriction makes that nigh impossible. Type-Level: a xor b = c  Type-Level a  b = c  Type-Level a  b = c %...and every boolean is in that set. : This lets us avoid carrying the closure parameter around Let them be shown /    . 1non-portable (FD and MPTC, undecidable-instances) experimentalEdward Kmett <ekmett@gmail.com> Safe-Infered  1non-portable (MPTC, FD, and missing constructors) experimentalEdward Kmett <ekmett@gmail.com> Safe-Infered              non-portable (FD and MPTC) experimentalEdward Kmett <ekmett@gmail.com> Safe-Infered"!RCount the number of bits set. Since we may have an infinite tail of 1s, we return G a negative number in such cases indicating how many bits are NOT set. "SCount the number of bits set, but track whether the number is positive or negative T to simplify casing. Since we may have an infinite tail of 1s, we return a negative < number in such cases indicating how many bits are NOT set. #toggle the value of bit #b in a, yielding c $ change bit #"b in a to c in {T,F}, yielding d. %set bit #b in a to F, yielding c &set bit #b in a to T, yielding c. 'get bit #b in a as c in {T,F} (3Shift a right b places obtaining c in normal form. ( | If b is negative then we shift left. )IShift a right b places obtaining c. If b is negative then we shift left.  | TShift'% does not yield normal form answers. *Return the absolute value of a +BExponentiation: a^b = c (only defined for non-negative exponents) ,Multiplication: a * b = c -%Reversible adder with extra fundeps. .:Non-reversible subtraction. Kept for efficiency purposes. /7Non-reversible addition. Kept for efficiency purposes. 00Shed the additional reduction parameter from TNF' 1JTransform a number into normal form, but track whether further reductions = may be necessary if this number is extended for efficiency. 2CA symmetrical full adder, that does not yield normal form answers. 3/Returns true if the lsb of the number if false 4.Returns true if the lsb of the number is true 5,Returns true if the number is equal to zero 6-Returns true if the number is less than zero 70Returns true if the number is greater than zero 8=TNeg obtains the 2s complement of a number and is reversible 9We don'Rt want to have to carry the closure parameter around explicitly everywhere, so we  shed it here. ;[Our set of digits is closed to retain the properties needed for most of the classes herein <<Finds the unique successor for any normalized binary number =assert 2n+1 != n >assert 2n != n ?:Extracts the least significant bit of a as d and returns a'. ) Can also be used to prepend bit d onto a' obtaining a. We have a total order. <Equality comparison. Note this does not equate numbers that / are non-normalized with their normalized kin. 'TNot preserves normalization trivially .Show should express a value as legal haskell. !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~? !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\?A@<DE;9:8F6H7G5I4J3K-QR,S+T(V'W&X$Z%Y#[!\*U0LMN )12/O.P"?BC=>!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~non-portable (Template Haskell) experimentalEdward Kmett <ekmett@gmail.com>None]6$(binaryT n) returns the appropriate TBinary instance ^L$(binaryE n) returns an undefined value of the appropriate TBinary instance ]^]^^]]^ Lnon-portable (MPTC, FD, TH, undecidable instances, and missing constructors) experimentalEdward Kmett <ekmett@gmail.com>None^  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^Hnon-portable (MPTC, FD, TH, undecidable instances, missing constructors) experimentalEdward Kmett <ekmett@gmail.com>None,_`abcdefghijklmnopqrstuvwxyz{|}~,_`abcdefghijklmnopqrstuvwxyz{|}~,hijklmnopqrstuvwzyx{|}~gfedcb`a_+_`abcdefghijklmnopqrstuvwxyz{|}~Hnon-portable (MPTC, FD, TH, undecidable instances, missing constructors) experimentalEdward Kmett <ekmett@gmail.com>None6extract the least signficant nybble from a hex number L%%LHnon-portable (MPTC, FD, TH, undecidable instances, missing constructors) experimentalEdward Kmett <ekmett@gmail.com>None0$(hexT n) returns the appropriate THex instance F$(hexE n) returns an undefined value of the appropriate THex instance peasant exponentiator 4peasant exponentiator with explicit binary exponent UA simple peasant multiplier. TODO: exploit 2s complement and reverse the worst cases       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQR""      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQR Hnon-portable (MPTC, FD, TH, undecidable instances, missing constructors) experimentalEdward Kmett <ekmett@gmail.com>None _`abcdefghijklmnopqrstuvwxyz{|}~ non-portable (MPTC) experimentalEdward Kmett <ekmett@gmail.com> Safe-InferedSTUVWXYZ[\]^_`aSTUVWXYZ[\]^_`ab   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklm=>H@nopqrstuvwxyz{|}~?DPQRABCSTU9:;<X[\]^78_`          !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ghTUV^      !"#$%&'()*RS+ , - . / 0 1 2 3 4 5 6 7 8 9 :type-int-0.5.0.2Data.Type.Boolean Data.Type.OrdData.Type.SignData.Type.Binary.InternalsData.Type.Binary.THData.Type.Hex.Stage1Data.Type.Hex.Stage2Data.Type.Hex.Stage3Data.Type.MaybeData.Type.Binary Data.Type.HexTIftIfTNotTImpliesTXOrTXOr'TOrTAndTBoolFTtTtFtAndtOrtXOr'tXOrtImpliestNotTGtTLeTGeTLtTEqtEqtLttGetLetGtTSignPositiveSignZeroNegative TCountBits TCountBits'TComplementBit TChangeBit TUnSetBitTSetBitTGetBitTShiftTShift'TAbsTPowTMulTAddTSub'TAdd'TNFTNF'TAddC'TOddTEvenTIsZero TIsNegative TIsPositiveTNegTBinary fromTBinaryTCBinaryTSuccXIXOLSBIOtLSBtBSLtSucctPredtNeg tIsPositive tIsNegativetIsZerotEventOddtNFt2nt2np1tAdd'tSub'tAddtSubtMultPowtAbstShifttGetBittSetBit tUnSetBit tChangeBittComplementBit tCountBitsbinaryTbinaryESHR1THexfromTHex TrichotomyLSNtfhexxnhnxhxhx0h0xh0xFhFxhFx0FabcdmkXTmkHTtnotpositivenegativesignzerolsn trichotomyteventsucctaddc'tnf'thexshr1wrapI concatMapMDFDEDDDCDBDAD9D8D7D6D5D4D3D2D1D0HFHEHDHCHBHAH9H8H7H6H5H4H3H2H1H0ExtFExt0tLSNtNSLtAddC'tAddF'hexThexETPow' THexBinary TBinary2Hex THex2Binary THex2Binary' tHex2Binary tBinary2HexTMaybeTJustTNothingtNothingtJust tFromJustbaseGHC.Listorand$fShowT $fTIfTxyx $fTIfFxyy$fTNotFT$fTNotTF $fTImpliesTTT $fTImpliesTFF $fTImpliesFTT $fTImpliesFFT $fTXOrabc $fTXOr'TTF $fTXOr'TFT $fTXOr'FTT $fTXOr'FFF$fTOrTTT$fTOrTFT$fTOrFTT$fTOrFFF $fTAndTTT $fTAndFTF $fTAndTFF $fTAndFFF$fShowF$fTBoolF$fTBoolT$fTCBoolClosureF$fTCBoolClosureT$fClosedClosure $fTGtxyb'$fTCGtClosurexyb' $fTLexyb''$fTCLeClosurexyb'' $fTGexyb'$fTCGeClosurexyb'$fTEqFFT$fTEqFTF$fTEqTFF$fTEqTTT$fTEqPositivePositiveT$fTEqPositiveSignZeroF$fTEqPositiveNegativeF$fTEqSignZeroPositiveF$fTEqSignZeroSignZeroT$fTEqSignZeroNegativeF$fTEqNegativePositiveF$fTEqNegativeSignZeroF$fTEqNegativeNegativeT$fTSignPositive$fTSignSignZero$fTSignNegative$fTCSignClosureSignZero$fTCSignClosurePositive$fTCSignClosureNegative$fTLtabd$fTEqIOF$fTNotOI$fShowO$fTCountBitsab$fTCountBits'OnT$fTCountBits'ImF$fTCountBits'ImT$fTCountBits'OnF$fTCountBits'FFF$fTCountBits'TTT$fTComplementBitabd$fTChangeBitabcf$fTUnSetBitabd $fTSetBitabd $fTGetBitabd $fTShiftabc' $fTShift'aIO $fTShift'aOd $fTShift'TTT $fTShift'FTF $fTShift'OTa $fTShift'ITa $fTShift'OFO $fTShift'IFI $fTShift'TFT $fTShift'FFF$fTImpliesOOc'$fTImpliesIOc'$fTImpliesOIc'$fTImpliesIIc' $fTImpliesOTO $fTImpliesITI $fTImpliesTOO $fTImpliesTII $fTImpliesOFT $fTImpliesIFT $fTImpliesFOT $fTImpliesFIT $fTXOr'OOc' $fTXOr'OIc' $fTXOr'IOc' $fTXOr'IIc' $fTXOr'OTI $fTXOr'ITO $fTXOr'TOI $fTXOr'TIO $fTXOr'OFO $fTXOr'IFI $fTXOr'FOO $fTXOr'FII $fTOrOOc' $fTOrIOc' $fTOrOIc' $fTOrIIc'$fTOrOTT$fTOrITT$fTOrTOT$fTOrTIT$fTOrOFI$fTOrIFI$fTOrFOO$fTOrFII $fTAndOOc' $fTAndIOc' $fTAndOIc' $fTAndIIc' $fTAndOTO $fTAndITI $fTAndTOO $fTAndTII $fTAndOFF $fTAndIFF $fTAndFOF $fTAndFIF $fTAbsaa'' $fTPowaIe $fTPowaOd $fTPowaFI $fTMulaId $fTMulaOc $fTMulaTb $fTMulaFF $fTAddabc $fTSub'abc $fTAdd'abd'$fTEqOOb$fTEqIIb$fTEqIFF$fTEqITF$fTEqOTF$fTEqOFF$fTEqOIF$fTNFab $fTNF'Odb $fTNF'Idb $fTNF'OOT $fTNF'IIT $fTNF'OOT0 $fTNF'IIT0 $fTNF'ITF $fTNF'OFF $fTNF'TTF $fTNF'FFF $fTAddC'IITI $fTAddC'IIFO $fTAddC'OITO $fTAddC'OIFI $fTAddC'IOTO $fTAddC'IOFI $fTAddC'OOTI $fTAddC'OOFO $fTAddC'OTFI $fTAddC'IFTO $fTAddC'TOFI $fTAddC'FITO $fTAddC'ITFO $fTAddC'OFTI $fTAddC'TIFO $fTAddC'FOTI $fTAddC'ITTI $fTAddC'IFFI $fTAddC'OTTO $fTAddC'OFFO $fTAddC'TITI $fTAddC'FIFI $fTAddC'TOTO $fTAddC'FOFO $fTAddC'TTFO $fTAddC'FFTI $fTAddC'FTTF $fTAddC'TFFT $fTAddC'TTTT $fTAddC'FTFT $fTAddC'TFTF $fTAddC'FFFF $fTOddab' $fTEvenab $fTIsZeronb$fTIsNegativenb$fTIsPositivenb$fTrichotomyOb$fTrichotomyIb$fTrichotomyOb0$fTrichotomyIb0$fTrichotomyONegative$fTrichotomyIPositive$fTrichotomyFSignZero$fTrichotomyTNegative$fTNegac$fTNotIO$fShowI $fTBinaryI $fTBinaryO $fTBinaryT $fTBinaryF $fTCBinarycI $fTCBinarycO$fTCBinaryClosureT$fTCBinaryClosureF $fTSuccIO $fTSuccOI $fTSuccOI0 $fTSuccOT $fTSuccFI $fTSuccTF$fXIa$fXOa$fXITa$fXOFa$fLSBITI$fLSBITO$fLSBOFI$fLSBOFO$fLSBITF$fLSBOFT$fLSBTTT$fLSBFFF $fLSNFH0F $fLSNTHFT $fLSND0H0T $fLSND1H1F $fTEvenTF $fTEvenFT$fTHexDF$fTHexDE$fTHexDD$fTHexDC$fTHexDB$fTHexDA$fTHexD9$fTHexD8$fTHexD7$fTHexD6$fTHexD5$fTHexD4$fTHexD3$fTHexD2$fTHexD1$fTHexD0$fTHexT$fTHexF$fExtFa$fExt0a $fLSND0H0D0 $fTEvenD0T $fTNF'D0db $fTNF'DFdb $fTNF'DFTF $fTNF'D0FF $fTNotD0DF $fTNF'D1D1T $fTNF'D0D0T $fTNF'D1D1b14 $fTSuccDFD0 $fTSuccDET $fTSuccFD1 $fTSuccD1D2 $fTSuccD0D1 $fTSuccD0D115$fTrichotomyD1Positive$fTrichotomyD0Negative$fTAddC'D0TFDF$fTAddC'DFFTD0$fTAddC'TD0FDF$fTAddC'FDFTD0 $fTAddC'TTFDE $fTAddC'FFTD1$fTrichotomyD0b$fTAddC'TD0TD0$fTAddC'D0TTD0$fTAddC'FD0TD1$fTAddC'TD1FD0$fTAddC'D0FTD1$fTAddC'D1TFD0 $fSHR1H1TDE $fSHR1H0TDE $fSHR1H1FD1 $fSHR1H0FF$fShowDF$fShowDE$fShowDD$fShowDC$fShowDB$fShowDA$fShowD9$fShowD8$fShowD7$fShowD6$fShowD5$fShowD4$fShowD3$fShowD2$fShowD1$fShowD0$fTAddC'D0D0FD0 $fSHR1H0D0D00 $fTPowabc $fTPow'aIe $fTPow'aOd $fTPow'aFD1$fTHexBinaryab$fTBinary2Hexba'$fTHex2Binaryab'$fTHex2Binary'DFI$fTHex2Binary'DEO$fTHex2Binary'DDI$fTHex2Binary'DCO$fTHex2Binary'DBI$fTHex2Binary'DAO$fTHex2Binary'D9I$fTHex2Binary'D8O$fTHex2Binary'D7I$fTHex2Binary'D6O$fTHex2Binary'D5I$fTHex2Binary'D4O$fTHex2Binary'D3I$fTHex2Binary'D2O$fTHex2Binary'D1I$fTHex2Binary'D0O$fTHex2Binary'TT$fTHex2Binary'FF $fTMula1DFd $fTMula1DEd $fTMula1DDd $fTMula1DCd $fTMula1DBd $fTMula1DAd $fTMula1D9d $fTMula1D8d $fTMula1D7d $fTMula1D6d $fTMula1D5d $fTMula1D4d $fTMula1D3d $fTMula1D2d $fTMula1D1d $fTMula1D0c$fSHR1H0D0D016$fTLtTNothingTNothingF$fTLtTJustTNothingF$fTLtTNothingTJustT$fTLtTJustTJustr$fTEqTJustTJustr$fTEqTJustTNothingF$fTEqTNothingTJustF$fTEqTNothingTNothingT $fTMaybeTJust$fTMaybeTNothing$fTCMaybeClosureTJust$fTCMaybeClosureTNothing $fShowTJust$fShowTNothing