Skip to content

Commit

Permalink
fix(.): fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianVegaA committed Mar 4, 2023
1 parent bb4bec8 commit afc34b2
Show file tree
Hide file tree
Showing 23 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion examples/before_after_examples.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from src.sparrow.before_after import after, before
from sparrow.before_after import after, before


@after(lambda x: x + 1)
Expand Down
4 changes: 2 additions & 2 deletions examples/compose_examples.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from operator import add, mod, mul, sub

from src.sparrow.compose import compose
from src.sparrow.currify import currify
from sparrow.compose import compose
from sparrow.currify import currify

add, sub, mul, mod = map(currify, (add, sub, mul, mod))

Expand Down
6 changes: 3 additions & 3 deletions examples/reflex_examples.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from src.sparrow.compose import compose
from src.sparrow.currify import currify
from src.sparrow.reflex import reflex
from sparrow.compose import compose
from sparrow.currify import currify
from sparrow.reflex import reflex

add, sub, mul, mod = map(currify, (add, sub, mul, mod))

Expand Down
6 changes: 3 additions & 3 deletions examples/result_examples.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from src.sparrow.data.bifunctor import first, second
from src.sparrow.data.functor import fmap
from src.sparrow.data.result import Failure, Result, Success
from sparrow.data.bifunctor import first, second
from sparrow.data.functor import fmap
from sparrow.data.result import Failure, Result, Success


def inverse(x: int) -> Result[float, str]:
Expand Down
8 changes: 4 additions & 4 deletions examples/wrap_examples.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from src.sparrow.data.maybe import Maybe
from src.sparrow.data.result import Result
from src.sparrow.decorator.when import when
from src.sparrow.decorator.wrap import maybe, result
from sparrow.data.maybe import Maybe
from sparrow.data.result import Result
from sparrow.decorator.when import when
from sparrow.decorator.wrap import maybe, result


@maybe
Expand Down
6 changes: 3 additions & 3 deletions sparrow/datatype/maybe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from dataclasses import dataclass
from typing import Callable, Generic, Optional, TypeVar

from src.sparrow import T, V
from src.sparrow.datatype import DataType
from src.sparrow.kind.monad import Monad
from sparrow import T, V
from sparrow.datatype import DataType
from sparrow.kind.monad import Monad


class Maybe(Monad[T], DataType):
Expand Down
8 changes: 4 additions & 4 deletions sparrow/datatype/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
from dataclasses import dataclass
from typing import Callable, Generic, TypeVar

from src.sparrow import T, U, V, W, identity
from src.sparrow.datatype import DataType
from src.sparrow.kind.bifunctor import Bifunctor
from src.sparrow.kind.functor import Functor
from sparrow import T, U, V, W, identity
from sparrow.datatype import DataType
from sparrow.kind.bifunctor import Bifunctor
from sparrow.kind.functor import Functor


class Result(Functor[T], Bifunctor[T, V], DataType):
Expand Down
2 changes: 1 addition & 1 deletion sparrow/decorator/when.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from functools import wraps
from typing import Callable, TypeVar

from src.sparrow import identity
from sparrow import identity

T = TypeVar("T")

Expand Down
6 changes: 3 additions & 3 deletions sparrow/decorator/wrap.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from functools import wraps
from typing import Callable, Generic, Optional

from src.sparrow import T
from src.sparrow.datatype.maybe import Just, Maybe, Nothing
from src.sparrow.datatype.result import Failure, Result, Success
from sparrow import T
from sparrow.datatype.maybe import Just, Maybe, Nothing
from sparrow.datatype.result import Failure, Result, Success


def maybe(f: Callable[..., Optional[T]]) -> Callable[..., Maybe[T]]:
Expand Down
2 changes: 1 addition & 1 deletion sparrow/function/when.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Callable, Iterable, Sequence

from src.sparrow import T, V, identity
from sparrow import T, V, identity


def when(
Expand Down
6 changes: 3 additions & 3 deletions sparrow/kind/applicative.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Callable, TypeVar

from src.sparrow import T, U
from src.sparrow.kind import Kind, kind_function
from src.sparrow.kind.functor import Functor
from sparrow import T, U
from sparrow.kind import Kind, kind_function
from sparrow.kind.functor import Functor


class Applicative(Functor[T], Kind):
Expand Down
4 changes: 2 additions & 2 deletions sparrow/kind/bifunctor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Callable, Generic, TypeVar

from src.sparrow import T, U, V, W
from src.sparrow.kind import Kind, kind_function
from sparrow import T, U, V, W
from sparrow.kind import Kind, kind_function


class Bifunctor(Generic[T, U], Kind):
Expand Down
4 changes: 2 additions & 2 deletions sparrow/kind/functor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Callable, Generic, TypeVar

from src.sparrow import T, U
from src.sparrow.kind import Kind, kind_function
from sparrow import T, U
from sparrow.kind import Kind, kind_function


class Functor(Generic[T], Kind):
Expand Down
6 changes: 3 additions & 3 deletions sparrow/kind/monad.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Callable, TypeVar

from src.sparrow import T, U
from src.sparrow.kind import Kind, kind_function
from src.sparrow.kind.applicative import Applicative
from sparrow import T, U
from sparrow.kind import Kind, kind_function
from sparrow.kind.applicative import Applicative


class Monad(Applicative[T], Kind):
Expand Down
2 changes: 1 addition & 1 deletion tests/base_tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from src.sparrow import constant, identity
from sparrow import constant, identity

cases = [
(1, 1),
Expand Down
4 changes: 2 additions & 2 deletions tests/datatype/maybe_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import pytest

from src.sparrow import T, V
from src.sparrow.datatype.maybe import Just, Maybe, Nothing
from sparrow import T, V
from sparrow.datatype.maybe import Just, Maybe, Nothing

cases_fmap = [
(Just(1), lambda x: x + 1, Just(2)),
Expand Down
2 changes: 1 addition & 1 deletion tests/datatype/result_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from src.sparrow.datatype.result import Failure, Result, Success
from sparrow.datatype.result import Failure, Result, Success

T, V, W, U = TypeVar("T"), TypeVar("V"), TypeVar("W"), TypeVar("U")

Expand Down
2 changes: 1 addition & 1 deletion tests/decorator/before_after_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from src.sparrow.decorator.before_after import after, before
from sparrow.decorator.before_after import after, before

cases_before = [
(lambda x: x + 1, lambda x: x + 2, 1, 4),
Expand Down
4 changes: 2 additions & 2 deletions tests/decorator/compose_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import pytest

from src.sparrow.decorator.compose import compose
from src.sparrow.decorator.currify import currify
from sparrow.decorator.compose import compose
from sparrow.decorator.currify import currify

add, sub, mul, mod = map(currify, (add, sub, mul, mod))

Expand Down
4 changes: 2 additions & 2 deletions tests/decorator/reflex_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import pytest

from src.sparrow.decorator.compose import compose
from src.sparrow.decorator.reflex import reflex
from sparrow.decorator.compose import compose
from sparrow.decorator.reflex import reflex

partial_print = partial(print)

Expand Down
2 changes: 1 addition & 1 deletion tests/decorator/when_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from src.sparrow.decorator.when import when
from sparrow.decorator.when import when

cases = [
(lambda x: x != 0, lambda x: 1 / x, 2, 0.5),
Expand Down
6 changes: 3 additions & 3 deletions tests/decorator/wrap_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import pytest

from src.sparrow.datatype.maybe import Just, Nothing
from src.sparrow.datatype.result import Failure, Success
from src.sparrow.decorator.wrap import maybe, result
from sparrow.datatype.maybe import Just, Nothing
from sparrow.datatype.result import Failure, Success
from sparrow.decorator.wrap import maybe, result

case_maybe = [
(lambda *a, **k: 1, Just(1)),
Expand Down
2 changes: 1 addition & 1 deletion tests/function/when_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from src.sparrow.function.when import map_unless, map_when, unless, when
from sparrow.function.when import map_unless, map_when, unless, when

cases_when = [
(True, lambda x: x + 1, 1, lambda x: x + 2, 2),
Expand Down

0 comments on commit afc34b2

Please sign in to comment.