From ce4e99b7d6ee5d8106bda5d6526416b68bc11ffb Mon Sep 17 00:00:00 2001 From: Matvey Aksenov Date: Mon, 27 Feb 2017 20:54:45 +0000 Subject: [PATCH] Add the misssing bangs. --- src/Ldap/Asn1/Type.hs | 24 ++++++++++++------------ src/Ldap/Client.hs | 10 +++++----- src/Ldap/Client/Internal.hs | 10 +++++----- src/Ldap/Client/Modify.hs | 6 +++--- src/Ldap/Client/Search.hs | 2 +- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/Ldap/Asn1/Type.hs b/src/Ldap/Asn1/Type.hs index 897d4c2..a1e7a9b 100644 --- a/src/Ldap/Asn1/Type.hs +++ b/src/Ldap/Asn1/Type.hs @@ -37,7 +37,7 @@ data ProtocolServerOp = BindResponse !LdapResult !(Maybe ByteString) | SearchResultEntry !LdapDn !PartialAttributeList | SearchResultReference !(NonEmpty Uri) - | SearchResultDone !(LdapResult) + | SearchResultDone !LdapResult | ModifyResponse !LdapResult | AddResponse !LdapResult | DeleteResponse !LdapResult @@ -49,7 +49,7 @@ data ProtocolServerOp = -- | Not really a choice until SASL is supported. data AuthenticationChoice = - Simple ByteString + Simple !ByteString | Sasl !SaslMechanism !(Maybe Text) deriving (Show, Eq) @@ -77,16 +77,16 @@ data DerefAliases = -- | Conditions that must be fulfilled in order for the Search to match a given entry. data Filter = - And !(NonEmpty Filter) -- ^ All filters evaluate to @TRUE@ - | Or !(NonEmpty Filter) -- ^ Any filter evaluates to @TRUE@ - | Not Filter -- ^ Filter evaluates to @FALSE@ - | EqualityMatch AttributeValueAssertion -- ^ @EQUALITY@ rule returns @TRUE@ - | Substrings SubstringFilter -- ^ @SUBSTR@ rule returns @TRUE@ - | GreaterOrEqual AttributeValueAssertion -- ^ @ORDERING@ rule returns @FALSE@ - | LessOrEqual AttributeValueAssertion -- ^ @ORDERING@ or @EQUALITY@ rule returns @TRUE@ - | Present AttributeDescription -- ^ Attribute is present in the entry - | ApproxMatch AttributeValueAssertion -- ^ Same as 'EqualityMatch' for most servers - | ExtensibleMatch MatchingRuleAssertion + And !(NonEmpty Filter) -- ^ All filters evaluate to @TRUE@ + | Or !(NonEmpty Filter) -- ^ Any filter evaluates to @TRUE@ + | Not !Filter -- ^ Filter evaluates to @FALSE@ + | EqualityMatch !AttributeValueAssertion -- ^ @EQUALITY@ rule returns @TRUE@ + | Substrings !SubstringFilter -- ^ @SUBSTR@ rule returns @TRUE@ + | GreaterOrEqual !AttributeValueAssertion -- ^ @ORDERING@ rule returns @FALSE@ + | LessOrEqual !AttributeValueAssertion -- ^ @ORDERING@ or @EQUALITY@ rule returns @TRUE@ + | Present !AttributeDescription -- ^ Attribute is present in the entry + | ApproxMatch !AttributeValueAssertion -- ^ Same as 'EqualityMatch' for most servers + | ExtensibleMatch !MatchingRuleAssertion deriving (Show, Eq) data SubstringFilter = SubstringFilter !AttributeDescription !(NonEmpty Substring) diff --git a/src/Ldap/Client.hs b/src/Ldap/Client.hs index 2b4c98c..018a72c 100644 --- a/src/Ldap/Client.hs +++ b/src/Ldap/Client.hs @@ -119,10 +119,10 @@ newLdap = Ldap -- | Various failures that can happen when working with LDAP. data LdapError = - IOError IOError -- ^ Network failure. - | ParseError Asn1.ASN1Error -- ^ Invalid ASN.1 data received from the server. - | ResponseError ResponseError -- ^ An LDAP operation failed. - | DisconnectError Disconnect -- ^ Notice of Disconnection has been received. + IOError !IOError -- ^ Network failure. + | ParseError !Asn1.ASN1Error -- ^ Invalid ASN.1 data received from the server. + | ResponseError !ResponseError -- ^ An LDAP operation failed. + | DisconnectError !Disconnect -- ^ Notice of Disconnection has been received. deriving (Show, Eq) newtype WrappedIOError = WrappedIOError IOError @@ -130,7 +130,7 @@ newtype WrappedIOError = WrappedIOError IOError instance Exception WrappedIOError -data Disconnect = Disconnect Type.ResultCode Dn Text +data Disconnect = Disconnect !Type.ResultCode !Dn !Text deriving (Show, Eq, Typeable) instance Exception Disconnect diff --git a/src/Ldap/Client/Internal.hs b/src/Ldap/Client/Internal.hs index 730771c..07c10a7 100644 --- a/src/Ldap/Client/Internal.hs +++ b/src/Ldap/Client/Internal.hs @@ -51,17 +51,17 @@ data Host = deriving (Show) -- | A token. All functions that interact with the Directory require one. -data Ldap = Ldap +newtype Ldap = Ldap { client :: TQueue ClientMessage } deriving (Eq) -data ClientMessage = New Request (TMVar (NonEmpty Type.ProtocolServerOp)) +data ClientMessage = New !Request !(TMVar (NonEmpty Type.ProtocolServerOp)) type Request = Type.ProtocolClientOp type InMessage = Type.ProtocolServerOp type Response = NonEmpty InMessage -- | Asynchronous LDAP operation. Use 'wait' or 'waitSTM' to wait for its completion. -data Async a = Async (STM (Either ResponseError a)) +newtype Async a = Async (STM (Either ResponseError a)) instance Functor Async where fmap f (Async stm) = Async (fmap (fmap f) stm) @@ -72,8 +72,8 @@ newtype Dn = Dn Text -- | Response indicates a failed operation. data ResponseError = - ResponseInvalid Request Response -- ^ LDAP server did not follow the protocol, so @ldap-client@ couldn't make sense of the response. - | ResponseErrorCode Request Type.ResultCode Dn Text -- ^ The response contains a result code indicating failure and an error message. + ResponseInvalid !Request !Response -- ^ LDAP server did not follow the protocol, so @ldap-client@ couldn't make sense of the response. + | ResponseErrorCode !Request !Type.ResultCode !Dn !Text -- ^ The response contains a result code indicating failure and an error message. deriving (Show, Eq, Typeable) instance Exception ResponseError diff --git a/src/Ldap/Client/Modify.hs b/src/Ldap/Client/Modify.hs index 656c862..e5520d9 100644 --- a/src/Ldap/Client/Modify.hs +++ b/src/Ldap/Client/Modify.hs @@ -40,9 +40,9 @@ import Ldap.Client.Internal -- | Type of modification being performed. data Operation = - Delete Attr [AttrValue] -- ^ Delete values from the attribute. Deletes the attribute if the list is empty or all current values are listed. - | Add Attr [AttrValue] -- ^ Add values to the attribute, creating it if necessary. - | Replace Attr [AttrValue] -- ^ Replace all existing values of the attribute with the new list. Deletes the attribute if the list is empty. + Delete !Attr ![AttrValue] -- ^ Delete values from the attribute. Deletes the attribute if the list is empty or all current values are listed. + | Add !Attr ![AttrValue] -- ^ Add values to the attribute, creating it if necessary. + | Replace !Attr ![AttrValue] -- ^ Replace all existing values of the attribute with the new list. Deletes the attribute if the list is empty. deriving (Show, Eq) -- | Perform the Modify operation synchronously. Raises 'ResponseError' on failures. diff --git a/src/Ldap/Client/Search.hs b/src/Ldap/Client/Search.hs index 681aaa7..fcc21dc 100644 --- a/src/Ldap/Client/Search.hs +++ b/src/Ldap/Client/Search.hs @@ -215,7 +215,7 @@ data Filter = | !Attr :~= !AttrValue -- ^ Attribute's value approximately matches the assertion | !Attr :=* !(Maybe AttrValue, [AttrValue], Maybe AttrValue) -- ^ Glob match - | (Maybe Attr, Maybe Attr, Bool) ::= AttrValue + | !(Maybe Attr, Maybe Attr, Bool) ::= !AttrValue -- ^ Extensible match -- | Entry found during the Search.