Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003962OCamlOCaml otherlibspublic2006-01-25 14:472014-01-09 17:29
ReporterChristophe Troestler 
Assigned Togasche 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusresolvedResolutionno change required 
PlatformOSOS Version
Product Version3.09.0 
Target VersionFixed in Version4.02.0+dev 
Summary0003962: polymorphic Bigarray.kind_eq
DescriptionIt would be nice to have the following function in Bigarray

  val kind_eq : ('a, 'b) Bigarray.kind -> ('c, 'd) Bigarray.kind -> bool

While not difficult to write, it requires the use of Obj.magic which is better to avoid in ones code. In the same vein,

  val layout_eq : 'a Bigarray.layout -> 'b Bigarray.layout -> bool

would be nice as well (or [is_fortran_layout : 'a Bigarray.layout -> bool] and [is_c_layout : 'a Bigarray.layout -> bool]).
TagsNo tags attached.
Attached Files

- Relationships
related to 0006064resolvedgasche Expose a GADT representation for Bigarray.kind 

-  Notes
(0003526)
Christophe Troestler (reporter)
2006-01-30 23:55

Actually more is necessary:
val kind_match :
  float:(float -> 'a) ->
  complex:(Complex.t -> 'a) ->
  int:(int -> 'a) ->
  int32:(int32 -> 'a) ->
  int64:(int64 -> 'a) ->
  nativeint:(nativeint -> 'a) ->
  char:(char -> 'a) -> ('b, 'c) Bigarray.kind -> 'b -> 'a
val kind_make :
  float:('a -> float) ->
  complex:('a -> Complex.t) ->
  int:('a -> int) ->
  int32:('a -> int32) ->
  int64:('a -> int64) ->
  nativeint:('a -> nativeint) ->
  char:('a -> char) -> ('b, 'c) Bigarray.kind -> 'a -> 'b
val kind_map :
  float:(float -> float) ->
  complex:(Complex.t -> Complex.t) ->
  int:(int -> int) ->
  int32:(int32 -> int32) ->
  int64:(int64 -> int64) ->
  nativeint:(nativeint -> nativeint) ->
  char:(char -> char) -> ('a, 'b) Bigarray.kind -> 'a -> 'a

One probably wants to distinguish between float32 and float64, etc. (and not only between OCaml types as above) and to change the names which may not be so good.
I can provide more info on the application if that can serve as a motivation.
(0010787)
gasche (developer)
2014-01-09 17:29

Having this directly in the library is not necessary anymore thanks to PR#6064. For kind_eq you could even in the equal case build a GADT witness that the types are indeed compatible.

- Issue History
Date Modified Username Field Change
2006-01-25 14:47 Christophe Troestler New Issue
2006-01-30 23:55 Christophe Troestler Note Added: 0003526
2006-03-29 16:31 doligez Status new => acknowledged
2012-06-21 20:12 frisch Category OCaml general => OCaml otherlibs
2013-07-16 12:10 lpw25 Relationship added related to 0006064
2014-01-09 17:29 gasche Note Added: 0010787
2014-01-09 17:29 gasche Status acknowledged => resolved
2014-01-09 17:29 gasche Fixed in Version => 4.02.0+dev
2014-01-09 17:29 gasche Resolution open => no change required
2014-01-09 17:29 gasche Assigned To => gasche


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker