From 811555484737feea19d82e4a5c3024c62de875ff Mon Sep 17 00:00:00 2001 From: rustra Date: Tue, 10 Mar 2020 22:44:54 +0100 Subject: [PATCH] Minor changes in specs --- lib/rdf/datatypes/boolean.ex | 11 +++++------ lib/rdf/serialization/decoder.ex | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/rdf/datatypes/boolean.ex b/lib/rdf/datatypes/boolean.ex index 30a70eb..d1d020c 100644 --- a/lib/rdf/datatypes/boolean.ex +++ b/lib/rdf/datatypes/boolean.ex @@ -6,7 +6,6 @@ defmodule RDF.Boolean do use RDF.Datatype, id: RDF.Datatype.NS.XSD.boolean import Literal.Guards - alias Literal @type value :: boolean @type input :: value | String.t | number @@ -95,7 +94,7 @@ defmodule RDF.Boolean do see """ - @spec fn_not(value | input | Literal.t | any) :: Literal.t | nil + @spec fn_not(Literal.t | any) :: Literal.t | nil def fn_not(value) do case ebv(value) do %Literal{value: true} -> RDF.Boolean.Value.false @@ -127,7 +126,7 @@ defmodule RDF.Boolean do see """ - @spec logical_and(value | input | Literal.t | any, value | input | Literal.t | any) :: + @spec logical_and(Literal.t | any, Literal.t | any) :: Literal.t | nil def logical_and(left, right) do case ebv(left) do @@ -171,7 +170,7 @@ defmodule RDF.Boolean do see """ - @spec logical_or(value | input | Literal.t | any, value | input | Literal.t | any) :: + @spec logical_or(Literal.t | any, Literal.t | any) :: Literal.t | nil def logical_or(left, right) do case ebv(left) do @@ -209,7 +208,7 @@ defmodule RDF.Boolean do - """ - @spec ebv(value | input | Literal.t | any) :: Literal.t | nil + @spec ebv(Literal.t | any) :: Literal.t | nil def ebv(value) def ebv(true), do: RDF.Boolean.Value.true @@ -245,7 +244,7 @@ defmodule RDF.Boolean do @doc """ Alias for `ebv/1`. """ - @spec effective(value | input | Literal.t | any) :: Literal.t | nil + @spec effective(Literal.t | any) :: Literal.t | nil def effective(value), do: ebv(value) end diff --git a/lib/rdf/serialization/decoder.ex b/lib/rdf/serialization/decoder.ex index 9b68621..8bacd8b 100644 --- a/lib/rdf/serialization/decoder.ex +++ b/lib/rdf/serialization/decoder.ex @@ -29,7 +29,7 @@ defmodule RDF.Serialization.Decoder do @behaviour unquote(__MODULE__) @impl unquote(__MODULE__) - @spec decode!(String.t) :: RDF.Graph.t | RDF.Dataset.t + @spec decode!(String.t, keyword | map) :: RDF.Graph.t | RDF.Dataset.t def decode!(content, opts \\ []) do case decode(content, opts) do {:ok, data} -> data