Skip to content

Commit 82766af

Browse files
Merge pull request #26 from FluxML/cl/refvalue
functor RefValue
2 parents 7515afb + 3bc7694 commit 82766af

File tree

6 files changed

+12
-3
lines changed

6 files changed

+12
-3
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Functors"
22
uuid = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
33
authors = ["Mike J Innes <[email protected]>"]
4-
version = "0.2.6"
4+
version = "0.2.7"
55

66
[compat]
77
julia = "1"

src/Functors.jl

+1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ module Functors
33
export @functor, @flexiblefunctor, fmap, fmapstructure, fcollect
44

55
include("functor.jl")
6+
include("base.jl")
67

78
end # module

src/base.jl

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@functor Base.RefValue

test/base.jl

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@testset "Base" begin
2+
@testset "RefValue" begin
3+
x = Ref(1)
4+
p, re = Functors.functor(x)
5+
@test p == (x = 1,)
6+
@test re(p) isa Base.RefValue{Int}
7+
end
8+
end

test/basics.jl

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using Functors, Test
2-
31
struct Foo
42
x
53
y

test/runtests.jl

+1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ using Functors, Test
33
@testset "Functors.jl" begin
44

55
include("basics.jl")
6+
include("base.jl")
67

78
end

0 commit comments

Comments
 (0)