git.iko.soy/rowtype-yoga/purescript-backend-optimizer
on main help sign in
17 lines 435 B history raw
1module Snapshot.PrimOpArray01 where
3import Data.Array (length, unsafeIndex)
4import Data.Array.NonEmpty as NEA
5import Partial.Unsafe (unsafePartial)
7test1 :: forall a. Array a -> Int
8test1 a = length a
10test2 :: forall a. Array a -> a
11test2 a = unsafePartial unsafeIndex a 2
13test3 :: forall a. NEA.NonEmptyArray a -> Int
14test3 a = NEA.length a
16test4 :: forall a. NEA.NonEmptyArray a -> a
17test4 a = unsafePartial NEA.unsafeIndex a 2