0.3.1 Release (#133)

This commit is contained in:
Adam Wespiser
2022-03-12 21:42:32 -05:00
committed by GitHub
parent 1b453b6064
commit 3e249724fd
7 changed files with 71 additions and 50 deletions
+7 -2
View File
@@ -270,8 +270,6 @@ import Data.List.NonEmpty as List (
import Data.Semigroup as Semigroup (
Semigroup(sconcat, stimes)
, WrappedMonoid
, Option(..)
, option
, diff
, cycle1
, stimesMonoid
@@ -281,6 +279,13 @@ import Data.Semigroup as Semigroup (
)
#endif
#if MIN_VERSION_base(4,9,0) && !MIN_VERSION_base(4,16,0)
import Data.Semigroup as Semigroup (
Option(..)
, option
)
#endif
import Data.Monoid as Monoid
#if !MIN_VERSION_base(4,8,0)
+35 -4
View File
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE Unsafe #-}
{-# LANGUAGE NoImplicitPrelude #-}
@@ -12,13 +13,21 @@ module Protolude.Unsafe (
unsafeRead,
) where
import Protolude.Base (Int, HasCallStack)
import Protolude.Base (Int)
#if ( __GLASGOW_HASKELL__ >= 800 )
import Protolude.Base (HasCallStack)
#endif
import Data.Char (Char)
import Text.Read (Read, read)
import qualified Data.List as List
import qualified Data.Maybe as Maybe
import qualified Control.Exception as Exc
unsafeThrow :: Exc.Exception e => e -> a
unsafeThrow = Exc.throw
#if ( __GLASGOW_HASKELL__ >= 800 )
unsafeHead :: HasCallStack => [a] -> a
unsafeHead = List.head
@@ -37,8 +46,30 @@ unsafeFromJust = Maybe.fromJust
unsafeIndex :: HasCallStack => [a] -> Int -> a
unsafeIndex = (List.!!)
unsafeThrow :: Exc.Exception e => e -> a
unsafeThrow = Exc.throw
unsafeRead :: (HasCallStack, Read a) => [Char] -> a
unsafeRead = Text.Read.read
#endif
#if ( __GLASGOW_HASKELL__ < 800 )
unsafeHead :: [a] -> a
unsafeHead = List.head
unsafeTail :: [a] -> [a]
unsafeTail = List.tail
unsafeInit :: [a] -> [a]
unsafeInit = List.init
unsafeLast :: [a] -> a
unsafeLast = List.last
unsafeFromJust :: Maybe.Maybe a -> a
unsafeFromJust = Maybe.fromJust
unsafeIndex :: [a] -> Int -> a
unsafeIndex = (List.!!)
unsafeRead :: Read a => [Char] -> a
unsafeRead = Text.Read.read
#endif