Skip to content

Instantly share code, notes, and snippets.

@yurrriq
Last active November 2, 2015 11:05
Show Gist options
  • Select an option

  • Save yurrriq/938b5d554bc091ea5450 to your computer and use it in GitHub Desktop.

Select an option

Save yurrriq/938b5d554bc091ea5450 to your computer and use it in GitHub Desktop.
lodox-0.0.2 output for lutil-0.7.0
> (ld-util:get-versions)
(#(erlang "18")
 #(emulator "7.1")
 #(driver-version "3.2")
 #(lfe "0.10.0")
 #(lutil "0.7.0")
 #(lodox "0.0.2"))
lfe -pa ./_build/default/lib/*/ebin -noshell \
    -eval '(lfe_io:fwrite "~p~n" `(,(ld-parse:docs "_build/default/lib/lutil/src")))'
(#(lutil
   (#(get-app-src-version/1
      (#M(arglists ((filename)) arity 1
          doc "Deprecated; kept for projects still using it."
          name get-app-src-version)))
    #(uuid4/0
      (#M(arglists (()) arity 0
          doc
          "Adapted from the implementation given here:
    https://github.com/afiskon/erlang-uuid-v4/blob/8c03a11524f6bccf984575877b533ef30a009175/src/uuid.erl
  "
          name uuid4)))
    #(uuid4/1
      (#M(arglists
          (((tuple 'type 'binary))
           ((tuple 'type 'list))
           ((tuple 'type 'atom)))
          arity 1 doc "A wrapper for uuid4/0." name uuid4)))))
 #(lutil-file
   (#(beams->files/1
      (#M(arglists ((beam-data)) arity 1
          doc
          "Given a list of beams (no .beam extension), return a list of files (with
  the .beam extension)."
          name beams->files)))
    #(check-deps/1
      (#M(arglists ((deps-subdirs)) arity 1
          doc
          "Given a list of dependency directories, check to see which subdirectories
  we actually care about. Those we don't want, return false."
          name check-deps)))
    #(dump-data/2
      (#M(arglists ((filename data)) arity 2
          doc
          "A convenience function for writing Erlang data to disk."
          name dump-data)))
    #(files->beams/1
      (#M(arglists ((file-data)) arity 1
          doc
          "This function handles two cases:

    * Given a list of 2-tuples #(module-name filename), with the filenames
      ending in '.beam', return a list of tuples with no '.beam' extension,
      e.g.: #(module-name rootname).
    * Given a list of filenames, return a list of beams (i.e., no file
      extensions)."
          name files->beams)))
    #(filter-deps/1
      (#M(arglists ((deps-subdirs)) arity 1
          doc
          "Filter the dependencies subdirectories to return only the ones that pass
  the check-deps criteria."
          name filter-deps)))
    #(get-beam-attrs/1
      (#M(arglists ((beam)) arity 1
          doc
          "Given an atom representing a plugin's name, return its module
  attributes."
          name get-beam-attrs)))
    #(get-beam-behaviours/1
      (#M(arglists ((beam)) arity 1
          doc
          "Given an atom representing a plugin's name, return its module
  attributes."
          name get-beam-behaviours)))
    #(get-beam-exports/1
      (#M(arglists ((beam)) arity 1
          doc "Given a beam path, return its exported functions."
          name get-beam-exports)))
    #(get-cwd/0
      (#M(arglists (()) arity 0
          doc
          "The current workding directory in this case is the directory that the user
  executed lfetool *from*. Shortly after it starts up, the lfetool script
  switches from this dir to the actual directory where the lfetool code/library
  lives. To preserve the original cwd, it is passed as a parameter to erl
  during start up. That value is accessed with this function."
          name get-cwd)))
    #(get-deps-dir/0
      (#M(arglists (()) arity 0
          doc
          "Get the default dependency directories for the current directory."
          name get-deps-dir)))
    #(get-deps-subdirs/1
      (#M(arglists ((deps-dirs)) arity 1
          doc
          "Given a set of dependency directories, get a list of lists, where each
  of the lists is the list of directories in one of the passed deps dirs.
  Once the list of lists is obtained, collapse these into a single list."
          name get-deps-subdirs)))
    #(get-deps/1
      (#M(arglists ((deps-dirs)) arity 1
          doc
          "This function supports multiple dependency directories.

  Given a list of directories, each of which contains dependencies,
  return the full list of dependency directories, from all of the combined
  directories provided."
          name get-deps)))
    #(get-ebin-dir/0
      (#M(arglists (()) arity 0
          doc "Get the ebin directory for the current directory."
          name get-ebin-dir)))
    #(get-eunit-dir/0
      (#M(arglists (()) arity 0
          doc
          "Get the .eunit directory for the current directory."
          name get-eunit-dir)))
    #(get-local-dir/1
      (#M(arglists ((dir)) arity 1
          doc
          "Get the local path to a given dir, using (get-cwd)."
          name get-local-dir)))
    #(get-module-exports/1
      (#M(arglists ((module)) arity 1
          doc
          "Given an atom representing a module's name, return its exported functions."
          name get-module-exports)))
    #(get-src-dir/0
      (#M(arglists (()) arity 0
          doc "Get the src directory for the current directory."
          name get-src-dir)))
    #(get-test-dir/0
      (#M(arglists (()) arity 0
          doc "Get the test directory for the current directory."
          name get-test-dir)))))
 #(lutil-math
   (#(color-scale/2
      (#M(arglists ((value current-frame)) arity 2
          doc
          "Given a value and a range that value belongs to, calculate the value when
  scaled to the range 0 to 255."
          name color-scale)))
    #(dot-product/2
      (#M(arglists ((a b)) arity 2
          doc
          "This doesn't appear to be needed for this particular library, but it was fun
  to write, and is quite pretty, so it's staying ;-)"
          name dot-product)))
    #(factorial/1
      (#M(arglists ((n)) arity 1
          doc "Tail-recursive factrial function." name factorial)))
    #(factors/1
      (#M(arglists ((n)) arity 1
          doc "Tail-recursive prime factors function."
          name factors)))
    #(fast-floor/1
      (#M(arglists ((num)) arity 1
          doc
          "Sadly, this is named 'fast-floor' only because the Racket version was given
  that name. There is no good floor function in Erlang... so this should
  probably have been called 'slow-floor'.

  Old implementation has been replced with the code in floor/1. This function
  is kept for backwards compatibility."
          name fast-floor)))
    #(gcd/2
      (#M(arglists ((a 0) (a b)) arity 2
          doc "Get the greatest common divisor." name gcd)))
    #(get-closest/2
      (#M(arglists ((number numbers)) arity 2
          doc
          "Given a number and a list of numbers, the number in the list that is closest
  to the given number will be returned."
          name get-closest)))
    #(get-gradations/3
      (#M(arglists ((start inc count)) arity 3
          doc
          "Given a starting number, a number to add at each iteration, and a number of
  times to iterate, return a list of these incrementated gradations."
          name get-gradations)))
    #(get-next-prime/1
      (#M(arglists ((x)) arity 1
          doc "Get the next prime in ascending order."
          name get-next-prime)))
    #(prime?/1
      (#M(arglists ((x)) arity 1
          doc
          "If a number consists of more than two factors, it is not a prime number."
          name prime?)))
    #(round/2
      (#M(arglists ((number precision)) arity 2
          doc
          "Round a floating point number to the given number of decimal places."
          name round)))
    #(scale/3
      (#M(arglists
          ((value
            (tuple lower-bound upper-bound)
            (tuple lower-bound-prime upper-bound-prime)))
          arity 3
          doc
          "Given a value and a range that value belongs to, calculate a new value based
  upon a new range.

  This is useful, for instance, when one wants to convert a decimal value
  between 0.0 and 1.0 to a value between 0 and 255."
          name scale)))
    #(unit-scale/2
      (#M(arglists ((value current-frame)) arity 2
          doc
          "Given a value and a range that value belongs to, calculate the value when
  scaled to the range 0.0 to 1.0."
          name unit-scale)))
    #(xform-numbers/2
      (#M(arglists ((divisions numbers)) arity 2
          doc
          "The default precision for rounding decimals is two places."
          name xform-numbers)))))
 #(lutil-text
   (#(capitalized?/1
      (#M(arglists ((string)) arity 1
          doc
          "This function checks to see if the first letter of a passed string is
  capitalized.

  Capital letters range from 'A' (ASCII code 65) to 'Z' (ASCII code 90)."
          name capitalized?)))))
 #(lutil-type
   (#(add-tuples/1
      (#M(arglists ((a)) arity 1
          doc
          "Given a list of any number of tuples, add them all together."
          name add-tuples)))
    #(add-tuples/2
      (#M(arglists ((a b)) arity 2
          doc "Given two tuples, add them together."
          name add-tuples)))
    #(atom-cat/1
      (#M(arglists ((list-of-atoms)) arity 1
          doc "Concatenate n atoms." name atom-cat)))
    #(atom-cat/2
      (#M(arglists ((atom-1 atom-2)) arity 2
          doc "Concatenate two atoms." name atom-cat)))
    #(get-in/2
      (#M(arglists ((data keys)) arity 2
          doc
          "DEPRECATED

  This function was not intended to be used directly (though one certainly
  might have) but rather was to be used via the macro that used to be defined
  in include/core.lfe.

  That macro is now in the clj library in include/seq.lfe and the get-in
  function is in the module clj-seq.lfe.
  "
          name get-in)))
    #(orddict-merge/2
      (#M(arglists ((options1 options2)) arity 2
          doc
          "Merge two orddicts.

  That which is added latter will over-write what was previous. As such,
  options2 has presedence over options1."
          name orddict-merge)))
    #(pair-dict/1
      (#M(arglists ((data)) arity 1
          doc
          "'data' is a list of implicit pairs:
    * the odd elements are keys of type 'atom'
    * the even elemnts are the values.

  This list is partitioned. zipped to tuples, and then converted to a dict."
          name pair-dict)))
    #(partition-list/1
      (#M(arglists ((list-data)) arity 1
          doc
          "This function takes lists of even length with an implicit key (atom) value
  pairing and generates a list of two lists: one with all the keys, and the
  other with all the values."
          name partition-list)))
    #(rename-key/3
      (#M(arglists ((old-key new-key old-proplist)) arity 3
          doc
          "Given an old key, a new key, and an proplist to operate upon, rename the
  keys. This is essentially a create-new-k/v followed by a delete-old-k/v
  set of operations."
          name rename-key))))))
@yurrriq

yurrriq commented Nov 2, 2015

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment