git.iko.soy/rowtype-yoga/purescript-arraybuffer-builder
on master help sign in
Relax some constraints issue #8
commit37eeab58de941a58e5ca3e5fd349bbae9987eee7 authorJames Brock <jamesbrock@gmail.com> dateTue 19 Apr 2022, 17:09 (4 years ago) parentc72c9e0
1 file changed+19−19
src/Data/ArrayBuffer/Builder.purs+19−19
src/Data/ArrayBuffer/Builder.purs+19−19
@@ -59,7 +59,7 @@ type PutM = WriterT Builder
5959type Put = PutM Effect
6060
6161-- | Build an `ArrayBuffer` with do-notation in any `MonadEffect`. *O(n)*
62−execPutM :: forall m. (MonadEffect m) => PutM m Unit -> m ArrayBuffer
62+execPutM :: forall m. MonadEffect m => PutM m Unit -> m ArrayBuffer
6363execPutM = Internal.execBuilder <=< execWriterT
6464
6565-- | Build an `ArrayBuffer` with do-notation in `Effect`. *O(n)*
@@ -84,73 +84,73 @@ execPut = execPutM
8484-- | putInt32be $ length messageBuilder
8585-- | tell messageBuilder
8686-- | ```
87−subBuilder :: forall m. (MonadEffect m) => PutM m Unit -> PutM m Builder
87+subBuilder :: forall m. Monad m => PutM m Unit -> PutM m Builder
8888subBuilder = lift <<< execWriterT
8989
9090-- | Append an `ArrayBuffer` to the builder.
91−putArrayBuffer :: forall m. (MonadEffect m) => ArrayBuffer -> PutM m Unit
91+putArrayBuffer :: forall m. Monad m => ArrayBuffer -> PutM m Unit
9292putArrayBuffer = tell <<< Internal.singleton <<< Internal.Buff
9393
9494-- | Append a `DataView` to the builder.
95−putDataView :: forall m. (MonadEffect m) => DataView -> PutM m Unit
95+putDataView :: forall m. Monad m => DataView -> PutM m Unit
9696putDataView = tell <<< Internal.singleton <<< Internal.View
9797
9898-- | Append either an `ArrayBuffer` or a `DataView` to the builder.
99−putDataBuff :: forall m. (MonadEffect m) => DataBuff -> PutM m Unit
99+putDataBuff :: forall m. Monad m => DataBuff -> PutM m Unit
100100putDataBuff = tell <<< Internal.singleton
101101
102102-- | Append an 8-bit unsigned integer (byte) to the builder.
103−putUint8 :: forall m. (MonadEffect m) => UInt -> PutM m Unit
103+putUint8 :: forall m. MonadEffect m => UInt -> PutM m Unit
104104putUint8 = putArrayBuffer <=< Internal.encodeUint8
105105
106106-- | Append an 8-bit two’s-complement signed integer (char) to the builder.
107−putInt8 :: forall m. (MonadEffect m) => Int -> PutM m Unit
107+putInt8 :: forall m. MonadEffect m => Int -> PutM m Unit
108108putInt8 = putArrayBuffer <=< Internal.encodeInt8
109109
110110-- | Append a 16-bit big-endian unsigned integer to the builder.
111−putUint16be :: forall m. (MonadEffect m) => UInt -> PutM m Unit
111+putUint16be :: forall m. MonadEffect m => UInt -> PutM m Unit
112112putUint16be = putArrayBuffer <=< Internal.encodeUint16be
113113
114114-- | Append a 16-bit little-endian unsigned integer to the builder.
115−putUint16le :: forall m. (MonadEffect m) => UInt -> PutM m Unit
115+putUint16le :: forall m. MonadEffect m => UInt -> PutM m Unit
116116putUint16le = putArrayBuffer <=< Internal.encodeUint16le
117117
118118-- | Append a 16-bit big-endian two’s-complement signed integer to the builder.
119−putInt16be :: forall m. (MonadEffect m) => Int -> PutM m Unit
119+putInt16be :: forall m. MonadEffect m => Int -> PutM m Unit
120120putInt16be = putArrayBuffer <=< Internal.encodeInt16be
121121
122122-- | Append a 16-bit little-endian two’s-complement signed integer to the builder.
123−putInt16le :: forall m. (MonadEffect m) => Int -> PutM m Unit
123+putInt16le :: forall m. MonadEffect m => Int -> PutM m Unit
124124putInt16le = putArrayBuffer <=< Internal.encodeInt16le
125125
126126-- | Append a 32-bit big-endian unsigned integer to the builder.
127−putUint32be :: forall m. (MonadEffect m) => UInt -> PutM m Unit
127+putUint32be :: forall m. MonadEffect m => UInt -> PutM m Unit
128128putUint32be = putArrayBuffer <=< Internal.encodeUint32be
129129
130130-- | Append a 32-bit little-endian unsigned integer to the builder.
131−putUint32le :: forall m. (MonadEffect m) => UInt -> PutM m Unit
131+putUint32le :: forall m. MonadEffect m => UInt -> PutM m Unit
132132putUint32le = putArrayBuffer <=< Internal.encodeUint32le
133133
134134-- | Append a 32-bit big-endian two’s-complement signed integer to the builder.
135−putInt32be :: forall m. (MonadEffect m) => Int -> PutM m Unit
135+putInt32be :: forall m. MonadEffect m => Int -> PutM m Unit
136136putInt32be = putArrayBuffer <=< Internal.encodeInt32be
137137
138138-- | Append a 32-bit little-endian two’s-complement signed integer to the builder.
139−putInt32le :: forall m. (MonadEffect m) => Int -> PutM m Unit
139+putInt32le :: forall m. MonadEffect m => Int -> PutM m Unit
140140putInt32le = putArrayBuffer <=< Internal.encodeInt32le
141141
142142-- | Append a 32-bit big-endian IEEE single-precision float to the builder.
143−putFloat32be :: forall m. (MonadEffect m) => Float32 -> PutM m Unit
143+putFloat32be :: forall m. MonadEffect m => Float32 -> PutM m Unit
144144putFloat32be = putArrayBuffer <=< Internal.encodeFloat32be
145145
146146-- | Append a 32-bit little-endian IEEE single-precision float to the builder.
147−putFloat32le :: forall m. (MonadEffect m) => Float32 -> PutM m Unit
147+putFloat32le :: forall m. MonadEffect m => Float32 -> PutM m Unit
148148putFloat32le = putArrayBuffer <=< Internal.encodeFloat32le
149149
150150-- | Append a 64-bit big-endian IEEE double-precision float to the builder.
151−putFloat64be :: forall m. (MonadEffect m) => Number -> PutM m Unit
151+putFloat64be :: forall m. MonadEffect m => Number -> PutM m Unit
152152putFloat64be = putArrayBuffer <=< Internal.encodeFloat64be
153153
154154-- | Append a 64-bit little-endian IEEE double-precision float to the builder.
155−putFloat64le :: forall m. (MonadEffect m) => Number -> PutM m Unit
155+putFloat64le :: forall m. MonadEffect m => Number -> PutM m Unit
156156putFloat64le = putArrayBuffer <=< Internal.encodeFloat64le