Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Fable.Beam.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<Description>Fable bindings for Erlang and BEAM/OTP</Description>
</PropertyGroup>
<ItemGroup>
<Compile Include="otp/Types.fs" />
<Compile Include="otp/Erlang.fs" />
<Compile Include="otp/GenServer.fs" />
<Compile Include="otp/Supervisor.fs" />
Expand Down
2 changes: 1 addition & 1 deletion src/otp/Application.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Fable.Beam.Application

open Fable.Core
open Fable.Beam.Erlang
open Fable.Beam

// fsharplint:disable MemberNames

Expand Down
22 changes: 2 additions & 20 deletions src/otp/Erlang.fs
Original file line number Diff line number Diff line change
@@ -1,32 +1,14 @@
/// Type bindings for Erlang BIFs (Built-in Functions)
/// See https://www.erlang.org/doc/apps/erts/erlang
[<RequireQualifiedAccess>]
module Fable.Beam.Erlang

open Fable.Core
open Fable.Beam

// Note: For selective receive, use Fable.Core.BeamInterop.Erlang.receive<'T>
// which is provided by Fable.Core and handled by the compiler.

// ============================================================================
// Opaque Erlang types
// ============================================================================

/// Erlang process identifier.
[<Erase>]
type Pid = Pid of obj

/// Erlang reference (from make_ref, monitor, etc.).
[<Erase>]
type Ref = Ref of obj

/// Erlang atom.
[<Erase>]
type Atom = Atom of obj

/// Erlang timer reference (from send_after, etc.).
[<Erase>]
type TimerRef = TimerRef of obj

// ============================================================================
// Process management
// ============================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/otp/Ets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Fable.Beam.Ets

open Fable.Core
open Fable.Beam.Erlang
open Fable.Beam

// fsharplint:disable MemberNames

Expand Down
2 changes: 1 addition & 1 deletion src/otp/GenServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Fable.Beam.GenServer

open Fable.Core
open Fable.Beam.Erlang
open Fable.Beam

// fsharplint:disable MemberNames

Expand Down
2 changes: 1 addition & 1 deletion src/otp/Io.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Fable.Beam.Io

open Fable.Core
open Fable.Beam.Erlang
open Fable.Beam

// fsharplint:disable MemberNames

Expand Down
2 changes: 1 addition & 1 deletion src/otp/Logger.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Fable.Beam.Logger

open Fable.Core
open Fable.Beam.Erlang
open Fable.Beam

// fsharplint:disable MemberNames

Expand Down
3 changes: 2 additions & 1 deletion src/otp/Os.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module Fable.Beam.Os

open Fable.Core
open Fable.Beam

// fsharplint:disable MemberNames

Expand Down Expand Up @@ -48,7 +49,7 @@ let version () : int * int * int = nativeOnly

/// Returns the current OS system time in the given unit (e.g., second, millisecond).
[<Emit("os:system_time($0)")>]
let systemTime (unit: Erlang.Atom) : int64 = nativeOnly
let systemTime (unit: Atom) : int64 = nativeOnly

/// Returns the current OS system time in seconds.
[<Emit("os:system_time(second)")>]
Expand Down
2 changes: 1 addition & 1 deletion src/otp/Supervisor.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Fable.Beam.Supervisor

open Fable.Core
open Fable.Beam.Erlang
open Fable.Beam

// fsharplint:disable MemberNames

Expand Down
2 changes: 1 addition & 1 deletion src/otp/Timer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Fable.Beam.Timer

open Fable.Core
open Fable.Beam.Erlang
open Fable.Beam

// fsharplint:disable MemberNames

Expand Down
20 changes: 20 additions & 0 deletions src/otp/Types.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/// Shared opaque types for Erlang/OTP bindings.
namespace Fable.Beam

open Fable.Core

/// Erlang process identifier.
[<Erase>]
type Pid = Pid of obj

/// Erlang reference (from make_ref, monitor, etc.).
[<Erase>]
type Ref = Ref of obj

/// Erlang atom.
[<Erase>]
type Atom = Atom of obj

/// Erlang timer reference (from send_after, etc.).
[<Erase>]
type TimerRef = TimerRef of obj
Loading
Loading