Search results

The Encode class is used to generate encoding functions of the form a -> Foreign using generics-rep deriving.

First, derive Generic for your data:

import Data.Generic.Rep

data MyType = MyType ...

derive instance genericMyType :: Generic MyType _

You can then use the genericEncode and genericEncodeJSON functions to encode your data as JSON.

P purescript-foreign-generic M Foreign.Generic.Class
encode :: forall a. Encode a => a -> Foreign
P purescript-foreign-generic M Foreign.Generic.Class
encode :: FormURLEncoded -> Maybe String

Encode FormURLEncoded as application/x-www-form-urlencoded.

P purescript-form-urlencoded M Data.FormURLEncoded
encode :: String -> Uint8Array

Encodes a String to a Uint8Array using UTF-8 encoding.

P purescript-encoding M Data.TextEncoder
encode :: Uint8Array -> String

Encode a Uint8Array to its (RFC 4648) Base64 representation.

Example:

encode $ encodeUtf8 "柿くへば鐘が鳴るなり法隆寺"
-- "5p+/44GP44G444Gw6ZCY44GM6bO044KL44Gq44KK5rOV6ZqG5a+6"
P purescript-b64 M Data.Binary.Base64
encode :: String -> String

Encode a String to its (RFC 4648) Base64 representation.

Example:

encode "柿くへば鐘が鳴るなり法隆寺"
-- "5p+/44GP44G444Gw6ZCY44GM6bO044KL44Gq44KK5rOV6ZqG5a+6"
P purescript-b64 M Data.String.Base64
encode :: forall m a b c d. Codec m a b c d -> c -> b
P purescript-codec M Data.Codec
encode :: Encoding -> String -> Uint8Array

Encodes a String to a Uint8Array with the given Encoding.

P purescript-text-encoding M Data.TextEncoding
encode :: forall a b c d. Codec (Except DecodeError) a b c d -> c -> b

Encodes a value as JSON using the specified code.

P purescript-codec-json M Data.Codec.JSON

The Encode class is used to generate encoding functions of the form a -> Foreign using generics-rep deriving.

First, derive Generic for your data:

import Data.Generic.Rep

data MyType = MyType ...

derive instance genericMyType :: Generic MyType _

You can then use the genericEncode and genericEncodeJSON functions to encode your data as JSON.

P purescript-open-foreign-generic M Foreign.Generic.Class
encode :: forall a. Encode a => a -> Foreign
P purescript-open-foreign-generic M Foreign.Generic.Class
encode :: String -> TextEncoder -> Uint8Array
P purescript-web-encoding M Web.Encoding.TextEncoder
encode :: (Array Int) -> Base58

FFI wrapper to decode an Array Byte to a Maybe Base58

P purescript-base58 M Data.Base58
encode :: forall a. CookieEncoder a => a -> String
P purescript-browser-cookies M Browser.Cookies.Data
encode :: forall a. WriteCBOR a => a -> Effect Buffer
P purescript-cbor-stream M Effect.CBOR
encode :: forall m a. MonadAff m => MonadThrow Error m => MonadRec m => WriteCBOR a => AsyncPipe (Maybe a) (Maybe Buffer) m Unit

Encode purescript values as CBOR buffers

P purescript-cbor-stream M Pipes.CBOR
encode :: Json -> ArrayBuffer
P purescript-msgpack M Data.MsgPack.Browser
encode :: Json -> Buffer
P purescript-msgpack M Data.MsgPack.Node
encode :: forall a. EncodeJson a => a -> Uint8Array
P purescript-msgpack-msgpack M Msgpack
encode :: String -> String
P purescript-node-he M Data.String.HtmlElements
encode :: forall e a. JsonDual Identity e a -> a -> Json
P purescript-polyform-validators M Polyform.Duals.Validators.Json
encode :: String -> Either Error String
P purescript-punycode M Web.Punycode
encode :: forall payload. WriteForeign payload => Secret -> Algorithm -> payload -> Effect Jwt

Encode to JWT.

P purescript-simple-jwt M Node.Simple.Jwt
encode :: forall a o op s. Symbiote a o op s => a -> s
P purescript-symbiote M Test.Serialization.Symbiote.Core
encode' :: forall a. EncodeJson a => a -> String
P purescript-msgpack-msgpack M Msgpack
encode' :: EncodeOptions -> String -> String
P purescript-node-he M Data.String.HtmlElements
encodeOp :: forall a o op s. Symbiote a o op s => op -> s
P purescript-symbiote M Test.Serialization.Symbiote.Core
encodeInt :: Int -> Json
P purescript-argonaut-codecs M Data.Argonaut.Encode.Encoders
P purescript-argonaut-codecs M Data.Argonaut.Encode.Class
encodeMap :: forall a b. Ord a => (a -> Json) -> (b -> Json) -> Map a b -> Json
P purescript-argonaut-codecs M Data.Argonaut.Encode.Encoders
P purescript-argonaut-codecs M Data.Argonaut.Encode.Class
encodeSet :: forall a. Ord a => (a -> Json) -> Set a -> Json
P purescript-argonaut-codecs M Data.Argonaut.Encode.Encoders
encodeURI :: String -> Maybe String
P purescript-js-uri M JSURI
P purescript-argonaut-generic M Data.Argonaut.Encode.Generic
encodeRep :: forall r. EncodeRep r => r -> Json
P purescript-argonaut-generic M Data.Argonaut.Encode.Generic
encodeUrl :: Uint8Array -> String

Encode a Uint8Array to a URL-safe Base64 representation.

Example:

encodeUrl $ encodeUtf8 "柿くへば鐘が鳴るなり法隆寺"
-- "5p-_44GP44G444Gw6ZCY44GM6bO044KL44Gq44KK5rOV6ZqG5a-6"
P purescript-b64 M Data.Binary.Base64
encodeUrl :: String -> String

Encode a String to a URL-safe Base64 representation.

Example:

encodeUrl "柿くへば鐘が鳴るなり法隆寺"
-- "5p-_44GP44G444Gw6ZCY44GM6bO044KL44Gq44KK5rOV6ZqG5a-6"
P purescript-b64 M Data.String.Base64
P purescript-js-maps M JS.Map.EncodeKey
encodeKey :: forall a. EncodeKey a => a -> String
P purescript-js-maps M JS.Map.EncodeKey
P purescript-kubernetes M Kubernetes.Api.Batch.V1
P purescript-aws-sdk-basic M AWS.CostExplorer.Types
P purescript-screeps-classy M Screeps.Lab
encodeOut :: forall a o op s. Symbiote a o op s => Proxy a -> o -> s
P purescript-symbiote M Test.Serialization.Symbiote.Core
P purescript-kubernetes M Kubernetes.Api.Core.V1
P purescript-classless-encode-json M Classless.EncodeJson.Generic
encodeUri :: String -> String
P purescript-payload M Payload.Client.Internal.EncodeUri
P purescript-payload M Payload.Client.Internal.Url
encodeUrl :: forall urlStr params. EncodeUrl urlStr params => Proxy urlStr -> Record params -> String
P purescript-payload M Payload.Client.Internal.Url
encodeUrl :: forall url params. EncodeUrl url params => Options -> Proxy url -> Record params -> String
P purescript-payload M Payload.Client.Queryable
P purescript-metrics M System.Metrics
encodeYml :: forall a. EncodeJson a => a -> String
P purescript-openapi3 M Yml
encodeYml :: forall a. EncodeJson a => a -> String
P purescript-purescript-openapi3 M Yml
encodeZ85 :: Uint32Array -> Effect String
P purescript-z85 M Data.ArrayBuffer.Z85
encodeChar :: Char -> Json
P purescript-argonaut-codecs M Data.Argonaut.Encode.Encoders
P purescript-argonaut-codecs M Data.Argonaut.Encode.Class
encodeJson :: forall a. EncodeJson a => a -> Json
P purescript-argonaut-codecs M Data.Argonaut.Encode.Class
encodeList :: forall a. (a -> Json) -> List a -> Json
P purescript-argonaut-codecs M Data.Argonaut.Encode.Encoders
encodeUnit :: Unit -> Json
P purescript-argonaut-codecs M Data.Argonaut.Encode.Encoders
P purescript-argonaut-codecs M Data.Argonaut.Encode.Class
encodeVoid :: Void -> Json
P purescript-argonaut-codecs M Data.Argonaut.Encode.Encoders
encodeArgs :: forall a. GenericEncodeArgs a => Options -> a -> List Foreign
P purescript-foreign-generic M Foreign.Generic.Class
encodeEnum :: forall a. GenericEncodeEnum a => GenericEnumOptions -> a -> Foreign
P purescript-foreign-generic M Foreign.Generic.EnumEncoding
encodeJSON :: forall a. Encode a => a -> String

Encode a JSON string using an Encode instance.

P purescript-foreign-generic M Foreign.Generic
encodeOpts :: forall a. GenericEncode a => Options -> a -> Foreign
P purescript-foreign-generic M Foreign.Generic.Class
encodeUtf8 :: String -> Uint8Array

Encodes a String to a Uint8Array using UTF-8 encoding. This is an alias for encode that is provided for symmetry with decodeUtf8.

P purescript-encoding M Data.TextEncoder
encodeUtf8 :: String -> Uint8Array

Encodes a String to a Uint8Array using UTF-8 encoding. This function is provided as a convenience as UTF-8 is the encoding you will probably be using most of the time.

P purescript-text-encoding M Data.TextEncoding

Encodes a value as HTML, using Smolder markup.

P purescript-trout M Type.Trout.ContentType.HTML
encodeHTML :: forall a. EncodeHTML a => a -> Markup Unit

Encode the given value as Smolder markup.

P purescript-trout M Type.Trout.ContentType.HTML
encodeArgs :: forall a. GenericEncodeArgs a => Options -> a -> List Foreign
P purescript-open-foreign-generic M Foreign.Generic.Class
P purescript-simplecrypto M Crypto.Simple
encodeEnum :: forall a. GenericEncodeEnum a => GenericEnumOptions -> a -> Foreign
P purescript-open-foreign-generic M Foreign.Generic.EnumEncoding
encodeInt8 :: forall m. MonadEffect m => Int -> m ArrayBuffer

Serialize an 8-bit two’s-complement signed integer (char) into a new ArrayBuffer.

P purescript-arraybuffer-builder M Data.ArrayBuffer.Builder.Internal
encodeInto :: String -> Uint8Array -> TextEncoder -> Effect { read :: Int, written :: Int }
P purescript-web-encoding M Web.Encoding.TextEncoder
encodeJson :: forall a. Generic a => a -> Json

Encode Json representation of a value which has a Generic type with Aeson options. The encoded data will be compatible with Haskell Aeson, if Aeson default options are used.

P purescript-argonaut-generic-codecs M Data.Argonaut.Generic.Aeson
encodeJson :: forall a. Generic a => a -> Json

Encode any Generic data structure into Json, formatted according to argonautOptions

P purescript-argonaut-generic-codecs M Data.Argonaut.Generic.Argonaut
encodeJSON :: forall a. Encode a => a -> String

Encode a JSON string using an Encode instance.

P purescript-open-foreign-generic M Foreign.Generic
encodeOpts :: forall a. GenericEncode a => Options -> a -> Foreign
P purescript-open-foreign-generic M Foreign.Generic.Class
P purescript-payload M Payload.Client.EncodeBody
encodeBody :: forall body. EncodeBody body => body -> String
P purescript-payload M Payload.Client.EncodeBody
encodeBool :: forall m. MonadEffect m => Boolean -> PutM m Unit

bool Scalar Value Type

P purescript-protobuf M Protobuf.Internal.Encode
P purescript-sketch M Sketch.Types
encodeImpl :: Foreign -> Effect Buffer
P purescript-cbor-stream M Effect.CBOR
P purescript-kubernetes M Kubernetes.Api.Version
P purescript-classless-encode-json M Classless.EncodeJson
P purescript-geojson M Data.Basic.Coordinates
P purescript-geojson M Data.MultiPoint
P purescript-geojson M Data.Point
P purescript-kubernetes M Kubernetes.Api.APIExtensions.V1Beta1
P purescript-screeps-classy M Screeps.RoomObject
P purescript-screeps-classy M Screeps.Link
P purescript-kubernetes M Kubernetes.Api.Core.V1
P purescript-screeps-classy M Screeps.Nuke
P purescript-sketch M Sketch.Types
P purescript-screeps-classy M Screeps.Road
P purescript-kubernetes M Kubernetes.Api.Rbac.V1
P purescript-kubernetes M Kubernetes.Api.Rbac.V1Alpha1
P purescript-kubernetes M Kubernetes.Api.Rbac.V1Beta1
P purescript-kubernetes M Kubernetes.Api.AdmissionRegistration.V1Alpha1
P purescript-sketch M Sketch.Types
P purescript-kubernetes M Kubernetes.Api.Meta.V1